From history it suggests that you might be having chronic GI infection giving rise to this problem.
Go for one ofloxacilin, tinidazole
combination medicine course for 3 days.
Take antispasmodic tablet like Dicyclomine
as and when required.
Take light diet like curd, rice and buttermilk.
Take plenty of water.
Ok and take care.