Painful intercourse

The past few weeks whenever my boyfriend and I have sex, it hurts so bad like he's stabbing me with a knife with himself. A few times I have to move all types of directions so that it won't hurt. I recently notice I've gained a little bit of weight around my stomach and back but have no idea if the two are related. Just curious if anyone else has had this happen before and what was it?! I'm planning to go to my. Dr