Do you know why this hurt ??

It was about my 5th time ever having sex and I was with my boyfriend when I got on top of him like I have before and when I went down I felt the realllly weird and kinda painful pressure on my wall when I was upright?? but when i leant forward it was fine and I kept going but then when I went to go upright again it hurt? pleeeaaase help, it's our favourite