I weed myself😳

Short story, I ran upstairs to change my top & all of a sudden i needed a wee LIKE REALLY BAD THAT IT HURT! So I ran to the toilet but i literally couldn’t hold it in so I had weed myself a little bit, I managed to finish my wee on the loo but it was so difficult to hold it & it was so sudden! My period is due in 9 days and I had sex with my boyfriend & he came in me about 5 & 4 days before my ovulation “due date”, I have no clue if it has something to do with that or not, I’m just not sure why it happened, does anyone have any ideas?