Agonizing stomach pain

Hello, a few days ago I had pizza in the evening, then imediently afterwards I had the worst stomach pain of my life. It kept me up all night and it feels like I have a knife in my stomach. I started throwing up and coughing up blood and having diarrhea. It ceased by morning, and then that evening I had a steak and some potatoes and i was fine. Then later that night I had a burger and fries and the process started again by waking me up at 2 am and not being able to sleep again because it was so painful, then I was fine by afternoon the next day. I have been too scared to eat, and I have not done so in two days. Any idea what this could be? I've already begun to get lightheaded and very fatigued because of me not eating. Any feedback would be greatly appreciated.

It sounds like these foods are upsetting your stomach; eliminate them from your diet and keep a food diary to see if anything else is irritating you. However, if you are coughing up blood, you should see your doctor.

This does not sound like something ibs related, this sounds like something more serious, especially because of the coughing up blood aspect. It may be just a weird virus, but you most definitly need to see a doctor as soon as you can. Eating light would be benefiticall to. Wishing you a quick recovery.