diarrhea and constipation at the same time?

I've been having diarrhea throughout the day but part of the day (especially at night) I feel like I can't eat because I get cramps if I do. It feels like I have to go to the bathroom but can't. Anyone have this or have any suggestions on how to deal with this?