UTI or something else please HELP

Okay so i went go to visit my boyfriend since we are in a long distance relationship. We hadn't had sex for 7 months. I had visited him for 4 days, and 3 out of the 4 we had protected sex. Two weeks later I'm back home, and I've been feeling the urge to pee a lot. This has happened to me before a while back. I went to the doctor, and she told me i was just constipated. Over time it went away, but now it's back again. Is it possible that i got constipated from having sex? or do i most likely have a UTI? I always pee after having sex to make sure to avoid it happening. I also have really bad anxiety because the thought that i might be pregnant scares me. Can someone please help me figure this out<3