where is the pain located? If it's above your belly button it is your stomach. You could have an ulcer
This is probably caused by the fact that you needed to have a BM, were somewhere where you couldn't, and tried to hold it in until another more convenient time.
Doing so will cause the stabbing pains you mention. This happened to me several times when I was a young teen, until someone explained to me what the problem was. Any doctor will tell you the same. And yes, it feels just like someone is stabbing you with a knife!