I think you are having
irritable bowel syndrome..How long you have been having this problem?Is it related to food intake?
The primary symptoms of IBS are
abdominal pain or discomfort in association with frequent
diarrhea or
constipation, a change in bowel habits. There may also be urgency for bowel movements, a feeling of incomplete evacuation , bloating or abdominal distention.
The cause of IBS is unknown, but several hypotheses have been proposed. The risk of developing IBS increases sixfold after
acute gastrointestinal infection. Post-infection, further risk factors are young age,
prolonged fever, anxiety, and
depression.
Some people with IBS are likely to have food intolerances.
There is no evidence that digestion of food or absorption of nutrients is problematic for those with IBS at rates different from those without IBS. However, the very act of eating or drinking can provoke an overreaction of the gastrocolic response in some patients with IBS due to their heightened visceral sensitivity, and this may lead to abdominal pain, diarrhea, and/or constipation.
There is convincing evidence that soluble fiber supplementation is effective in the general IBS population.
Medications may consist of stool softeners and laxatives in constipation-predominant IBS, and antidiarrheals in diarrhea-predominant IBS for mild symptom
The mind-body or brain-gut interactions has been proposed for irritable bowel syndrome and is gaining increasing research attention. For some patients psychological therapies may help with symptoms..
so i would recommend you to take some antidiarroheals and increased fibre rich diet ..