I understand you problem.
This is very common condition in people these days. It happen when you have food at unusual place and if the food is not fresh. And it is also happens when you're not taking food on time and also taking high fat foods, spicy foods, fried foods, sour foods, May cause this conditons.
So to avoid this take adequate water 2-3 liters and telegraphy foods and not stored food or food with preservatives. Have food on time.