Sex and bladder infections.

Okay to be clear, I'm not having sex with dirty guys so don't say it's lack
of hygiene. With my ex, I got a bladder infection from having sex. And I feel like I'm getting one again with this new guy. Why do I keep getting them? Could the fact I drank a lot of alcohol the other night contribute? Like dehydration wise?