The bladder symptoms started just a day ago, but when you get to the doctor, you learn your kidneys are infected, too. Experts say you probably didn’t do anything wrong, you’re just unlucky.

Kidney infections occur when bacteria get into the urinary tract and migrate upwards, infecting the bladder and sometimes the kidneys, too. “The most common bacteria involved are E coli,” said Dr. Ingride Richardson, an assistant professor of urology at the University of Pennsylvania Health System. “As part of their structure, the bacteria have ‘arms’ that allow them to climb up the urethra and spread to the kidneys.”

In the vast majority of cases, urinary tract infections (UTIs) don’t spread to the kidneys, according to Dr. Sarah Flury, a urologist at Northwestern University. There are about 6 million urinary tract infections each year in the United States and about 250,000 kidney infections, Flury added.

1. First and foremost, being a woman.

“There are anywhere from 15 to 20 cases per 10,000 women,” said Dr. Ja-Hong Kim, an associate clinical professor of urology at the David Geffen School of Medicine at the University of California, Los Angeles. “That’s compared to three to five cases per 10,000 among men.” The reason, Kim explained, is women have a shorter urethra, the tube that carries urine from the bladder out of the body. That means bacteria have a shorter trip to the bladder.

2. Your doctor didn’t order up a culture to determine the exact type of bacteria infecting your urinary tract.

“A lot of times, doctors don’t get a urine culture,” Richardson said. “They just give the most common [antibiotic] treatment.” Without a culture, doctors can’t tell whether someone has a drug-resistant infection. If he or she does, the infection can persist, raising the risk of kidney involvement.

3. You’ve encountered a particularly potent type of bacteria.

“Some bacteria will be virulent enough to travel to the kidney rapidly and cause an infection that affects the entire urinary tract,” Richardson said. “We do not know how rapid it is. Perhaps a woman has mild symptoms such as frequency or burning and thinks it will go away overnight, and the next morning wakes with a fever and pain. Most people are not receiving antibiotics immediately at the first sign of symptoms.”

4. You have kidney stones.

“They can harbor bacteria and cause infection,” Richardson said.

5. Anatomical issues that make it hard to completely clear the bladder when you urinate.

These can include structural abnormalities that cause some of the urine to wash back upstream rather than pass out of the body, Kim explained.

How to deal:

The best way of dealing with the problem is prevention. If you take steps to avoid a bladder infection, you’ll be much less likely to end up with infected kidneys.

Experts suggest these ways to ward off bladder infections:

–Drink a plenty of fluids. “The bladder is a self-cleaning organ,” Kim said.

–When you go to the bathroom, make sure you push all the urine out.

–Consume foods that help acidify your urine, like cranberry tablets and vitamin C, Kim suggests.

–Take a probiotic. By consuming yogurt with live cultures or a supplement containing probiotics, you’ll not only lower the risk of developing yeast infections, but will also lower the risk of bladder infections, Richardson explained.