Exercise and bowel movements

OK has anyone gone through this ?

I'm usually either constipated or have regular bowel movement once a day but every time I work out I get really loose almost diarrhea after. Like if I don't work out I'll be fine , but if I work out then a couple hours later my stomach hurts and I get loose bowel movements has anyone gone through this ?