ELI5: Does the body 'decide' between diarrhea and vomiting during gastric infections?

I had diarrhea around Christmas time. I spent a full day running to the toilet every half hour so I could fire-hose out more stinky stuff. The next day I was still sick but I hadn't eaten for 12 hours, so I thought I'd try a banana. I ate half a banana and drank some water. An hour later I threw up, violently. And of course the diarrhea continued. I tried the same thing the day after... half a banana. And again an hour later I threw up violently. So clearly, the connection between my stomach and my intestine was closed.

Fortunatley a day later I felt well enough (meaning, I didn't have to go to the toilet every half hour) that I could go to the store and buy some Imodium. That stuff works wonders.

/r/explainlikeimfive Thread