Bad constipation cramps

This morning I woke up with bad constipation cramps I was also sweating sorry tmi but I'm 17 weeks pregnant . I took milk of magnesia I think that's what cramped me up.