Contractions while having to poop?

Eme

I have had a sour stomach since yestarday and now I am having contractions that feel terrible but I can tell if it's just the contraction or if it's also because of my stomach being upset. My stomach is super hard but I feel alot of pressure like I have to poop as well.