I used to suffer from really bad attacks of irritable bowel syndrome (IBS). I finally figured out that my main problem is that I am lactose intolerant. So I have to avoid all dairy products - cheese, ice cream, milk etc... I use vanilla flavored soy or rice milk when I want a bowl of cereal and non-dairy creamer in my coffee.
For awhile I thought I might have celiac disease and started eliminating all wheat and gluten products from my diet. There are really good non-wheat pastas, bread mixes etc. on the market that I was using. I even used to follow the recipes in an IBS cookbook, but I'm married with two children, so it was getting expensive and time consuming to purchase and cook food for me and food for them. So I'm back to eating wheat products in moderation and seem to be doing okay.
The best thing I found to take for my stomach aches/pains is peppermint oil. It helps to relieve the bloating and gas which is usually associated with IBS. I get enteric coated peppermint capsules from my local Vitamin Shoppe. I used to take immodium AD all the time but then ended up constipated a few days latter. So now I only take immodium when I get really bad attacks.
Cinnamon is also supposed to help prevent diarrhea. I take cinnamon daily in capsule form - it is also supposed to help lower cholesterol levels and help keep your blood sugar levels stable.
For additional information on a few of the culinary herbs and spices that can help treat IBS, see my article: Herbal Remedies for IBS; Using Peppermint, Ginger, Cinnamon and Dill for Natural Healing.