'i have an upset stomach after eating spicy food?

Common issue... Please refer to the excellent, already posted, healthtap answers regarding diagnostic differential and treatment of dyspepsia/indigestion. Diet certainly plays a role in "stomach upset" as you imply. Moderate intake of spicy, greasy food, mints, alcohol, tobacco, caffeinated products, salicylates.