Hello
I had gone through your question diligently and I will try to help you out in best possible way
Pain in abdomen followed by loose stools can be caused by 
gastroenteritis, colitis or worm infestationand drug induced intestinal hypermotility
I would like further information to help you better like 
frequency of stools or whether it is associated with bleeding?
In my opinion you should consult your doctor for examination and 
stool test for ova cyst or parasite
You may require a course of antibiotics like 
tinidazole or 
metronidazole and probiotics
meanwhile try to observe good hygiene
wash your hands with antiseptic soap or solution after using wash room
Have plenty of fluids including ORS to avoid 
dehydration and electrolyte imbalances
have lots of fresh fruits and vegetables or dietary fibers 
Hope this answers your question
Best wishes