A.L.
I had this issue growing up and i still do. I have been diagnosed 3 times with Irritable Bowel Syndrome. I can go days and have gone up to 3 weeks with out a bowel movement and then I may go 2 days with straight diarrhea. Unfortunately this is what they diagnose you with when they can't find anything else wrong with you. I have had a sigmoidoscopy and a barium enema, neither of which are any fun. The last time I went to a gastroenterologist he wanted to do a upper GI scope and a colonoscopy but my insurance said it would go towards deductible first which was $5000 so i didn't do it. He also told me to lay off the High Fructose Corn Syrup. I would get online and do a search for diets pertaining to IBS-C. It couldn't hurt.
Best of luck!
I know how painful this can be. =(