My doctor has given me some pills for a sports injury. But every time I swallow one, I get a really bad pain in my tummy.

Then for heaven's sake, stop taking them! The pills we docs usually prescribe for sports and muscle injuries are what are called "non-steroidal antiinflammatory drugs" (NSAIDs). Unfortunately, nearly all NSAIDs can irritate the stomach. So as a rule, they should only be taken after food. And if they cause pain - stop them.