After being careful not to drink too much on New Year's Eve, you still wake up in the middle of the night vomiting.

As you spend the next several hours making too many trips to the bathroom, you wonder why you feel so sick when you barely drank any alcohol. Then you remember that the shrimp cocktail looked a little dodgy and that a few friends didn't make it to the party because they caught the stomach virus that's been going around.

Could you have picked up the stomach bug, too, or are you experiencing food-poisoning symptoms?  

Food poisoning and a stomach bug are essentially the same thing—a viral or bacterial infection that causes gastroenteritis, the medical term for inflammation of the stomach and intestines, which leads to vomiting and diarrhea.

The difference is whether you picked up the infection by eating something that had the germs in it or by touching a contaminated surface and transferring the germs from your hands to your mouth.

For the most part, infections caused by bacteria such as salmonella and E. coli are usually foodborne. Gastrointestinal viruses are environmentally spread and tend to be seasonal, peaking in the winter in one part of the country and the spring or summer in another.

But that’s not always the case. For example, noroviruses contaminate foods such as produce and shellfish and are a leading cause of foodborne illness, but they are highly contagious and spread rapidly on surfaces touched by people who are infected. (That's why they’re notorious for spreading on cruise ships.)

If your stomach just feels upset or you have heartburn, bloating, or gas but no vomiting or diarrhea, it’s probably indigestion, not an infection.

No matter how the germ causing your distress got into your system, the initial treatment is the same (read "How to Start Feeling Better," below).

Still, for several reasons it’s good to try to tease out whether the source of your troubles was something you ate. If you’ve got some of the offending food left over in your fridge or freezer, you don’t want to eat it (or let anyone else eat it).

Reporting suspected foodborne illness to local health department officials can start an investigation to pinpoint which food made you ill. That's especially important if it turns out you were sickened by a meal in a restaurant or from tainted foods that are still being sold in grocery stores.

And last, some types of foodborne illness can be fatal or may cause chronic health problems long after the diarrhea and vomiting have stopped. That’s why it’s crucial to know the warning signs that tell you it’s time to see a doctor rather than just toughing it out.

When Food Is Buggy

Chances are it’s food poisoning if someone else who ate the same food is sick as well, says Barbara Mahon, M.D., M.P.H., a medical epidemiologist at the Centers for Disease Control and Prevention.

But it’s possible to be sickened by food that doesn’t seem to bother anyone else simply because the burger or slice of melon that you happened to get was more heavily contaminated with disease-causing bacteria.

Food-poisoning symptoms—abdominal pain, stomach cramps, and multiple bouts of diarrhea or vomiting—tend to be more severe but shorter-lasting than when it’s a stomach bug.  

People who suspect they have food poisoning often assume it had to be from something they ate right before they started feeling sick, but that’s not always the case. Foodborne illnesses are caused by many different toxins or disease-causing bacteria, viruses, or parasites, and the symptoms you get and how soon you feel them vary based on which contaminant was in your food.  

For instance, you can be hit with severe nausea and vomiting just an hour after eating contaminated chicken salad that has a type of bacteria called Staphylococcus aureus. But it can take more than a week after having a burger containing E. coli O157 for you to have the severe diarrhea and other nasty symptoms it brings.

And the lag time between eating deli meat tainted with listeria bacteria and developing fever and muscle aches along with gastrointestinal symptoms may be more than a month. Check out this helpful foodborne-illness table from the Food and Drug Administration for more details about symptoms caused by the bacteria that are responsible for the most common ones, along with examples of foods in which they are found.

How to Start Feeling Better

Staying hydrated is the priority. Bouts of diarrhea or vomiting can mean that you’re losing more fluids and electrolytes than you’re taking in, which leads to dehydration.

The first symptoms of this include headaches and dizziness. But in severe cases, you can develop serious complications including swelling of the brain, seizures, and a life-threatening drop in blood volume and pressure.

To replace lost fluids and prevent dehydration, CDC officials recommend drinking oral rehydration solutions such as Ceralyte, Oralyte, or Pedialyte, which it says are more effective than sports drinks for treating foodborne illness.

But don’t automatically reach for anti-diarrheal medications such as Immodium (sold generically as loperamide). If you’re an otherwise healthy adult, they are generally safe to take, but if you can keep fluids down, you may want to tough it out.

“Diarrhea makes you feel terrible, but it’s not necessarily a bad thing. Slowing things down can make you feel better initially, but if you slow things down too much, it can cause more problems,” says Marsha Kay, M.D., chairwoman of pediatric gastroenterology at the Cleveland Clinic.

Definitely don’t use anti-diarrheals if you have bloody diarrhea or a fever higher than 101.5° F. Those are signs that bacteria may be damaging the lining of your intestines. In those circumstances, anti-diarrheal drugs can make your condition worse, because slowing down the movement of stool through your intestines means the harmful bacteria or toxins will linger there longer, providing more opportunity for them to pass through the damaged intestinal lining into your bloodstream and spread further.

When to See a Doctor

Contact a doctor if you have diarrhea that is bloody or that lasts for more than three days and is accompanied by any of the following:

  • Prolonged vomiting that makes you unable to keep liquids down.
  • A fever higher than 101.5° F.
  • Dehydration symptoms, such as decreased urination, a dry mouth and throat, and overwhelming thirst or dizziness when you're standing up.  

Your doctor will probably order stool and blood tests to pinpoint the cause. If it turns out that you have listeria or foodborne salmonella that has spread to the bloodstream, he or she will prescribe an antibiotic. The primary treatment is likely to be intravenous fluids to fight dehydration. In severe cases you may need to be hospitalized.

Some people are more vulnerable to foodborne infections in the first place and get sicker from them. For them, it might be a good idea to err on the side of caution by contacting a doctor when the first symptoms appear rather than waiting for those red flags.

Young children and elderly people who are sickened by E. coli O157 are at higher risk of developing a complication called hemolytic uremic syndrome, or HUS, which can cause life-threatening kidney damage, for instance. Others in higher risk groups include pregnant women and infants, as well as anyone who has underlying bowel disease such as ulcerative colitis or whose immune system is weakened by illness or treatments such as chemotherapy or long-term high-dose steroids.  

Reporting Your Case

If you end up at a doctor’s office or hospital, your case might automatically be reported to local health officials. But if not, it’s a good idea to contact the health department yourself. Foodborne illnesses are vastly underreported. According to CDC estimates, for every case of salmonella that's reported, there are another 29 cases, and for each case of E. coli O157, 26 other people are infected but don’t show up in the official count. You’ll find contact info for the appropriate local officials on your state health department's website. 

The health officials will ask about what you’ve eaten and where in order to identify which foods made you sick. They may ask you to provide a stool sample. And if you still have any of the tainted food in your fridge or freezer, they may take samples for testing, which can help alert them to a possible disease outbreak involving people in many states who were sickened by the same foodborne bacteria.

“People are sometimes squeamish about providing stool samples, but doing that and being willing to talk to health department investigators even at a time when you may not be feeling well is incredibly important,” Mahon says. “The information you provide not only can help end that outbreak more quickly, but what we learn often helps us prevent others from getting sick that way in the future.”