Hi there...since when have you been having this problem? Because if it is since few days then it could just acute gastroenteritis. If it is happening since long time, then it could towards inflammatory diseases like crohns disease, irritable bowel syndrome. Also are you on any medications? Because sometimes some strong antibiotics also can cause symptoms. Kindly consult a general surgeon for further evaluation. They might start you on medications like proton pump inhibitors and probiotics which help reduce pain and loose stools.