Painful Sex

I was having sex yesterday and my boyfriend was going really deep and it started hurting in the inside of my side. I couldn't finish due to the pain.  This might sound dumb, but should I be worried? It hurt to walk sometimes throughout the day afterwards. I'm supposed to be starting my period pretty soon, could that factor in?