Painful cramp

Im 5 weeks pregnant and last night was really weird. basically everytime I was getting really turned on in a dream I woke up because of a really bad pain in my stomach? This literally happened twice and it was such a bad pain I had to get up and go toilet. Any ideas what that was about?