STAY HYDRATED. No seriously, if you don't have to pee right now, you aren't drinking enough water, go drink a gallon and come back to read the rest later.
Disclaimer: Your body will react differently to most foods, these are general rules. Your allergies, intolerances and body chemistry may vary.
Foods that affect your voice will generally fall into 2 categories:
Mucus-Inducing Foods: These include all dairy products, as well as most sugary processed foods and candies, as well as chocolate. They will tend to produce a coating of mucus (or "slime") on your vocal folds, generally making it more difficult to sing/speak, though sometimes desirable if you are feeling particularly dry/raw/horse.
Drying Foods: These include salt and foods that emphasize it (nuts, chips, etc.), citrus foods (oranges, lemons, limes) and spicy foods. They have the pleasant effect of relieving the intense mucus of the previous category (also caused by allergies and food intolerances). However if not properly hydrated (do you have to pee yet?) it's best to avoid these foods near performance time.
In general avoid eating within an hour of performance to avoid losing the ability to properly support your tone from your core. If you aren't "peeing pale" then you aren't drinking enough water. And try to get your 5 servings of fruits and veggies a day, it will leave you feeling refreshed and energetic and give you the stamina to approach the major roles. Professional singers and speakers are athletes, and need to respect their bodies.
How have you noticed particular foods affecting your voice? Tell me in the comments.