It could very well be the
stomach flu
Other causes could be:
Food: such as you ate too much,
Getting checked for lactose intolerance may be a good idea,
Something that just normally upsets you e.g. Spicy foods,
Eating a food that's been around for a while and went bad.
Appendicitis
Stress
Tips to help you try and prevent this in the future:
Don't overeat,
Eat a good amount of fruits and vegetables,
Wash hands before eating,
Don't eat right before bedtime,
Get lots of sleep.