How long after you ate did you use the bathroom? Same thing happened to a friend of mine, I took him to doctor next day, and it was Food Poisoning, the burger he ate at a Restaurant was not cooked properly. The doctor asked him if he had brought a sample of the burger, so it could be sent to the lab, but he through it out. If your stomach is still off and your still dizzy, I would go to the doctor and get checked out
The reason you became lightheaded because the bowel movement activated the vagus nerve, which meanders around the body and at one point is in close proximity to the anal sphincter. That is why many people die on the toilet. Straining on the toilet, or even passing a bowel movement, can cause the heart-rate to drop from 20-40 beats per minute. This causes light-headedness and you may even faint. There is a genetic difference in vagus nerve sensitivity. As for the other bowel problems often this is due to a bacterial agent in the bowel. Pepto-bismal, an over-the-counter product which contains bismuth, a metal that kills bacteria, will usually clear the problem up.
Could be food poisining or a 24 hour virus. Drink a gator aid apparently when you used the bathroom you also let go of alot of water. You need to rehydrate and gator aid is the perfect solution. Hope this helps.