Welcome to HealthcareMagic.
If this has started recently in a day or two , you probably have an infection. You should visit your physician and get a stool examination done to know the presence of infection.Further antibiotic course can be prescribed.
If you are having these for long , you might be having a Chronic infection with Giardia or Irritable bowel syndrome
.Please visit your Gastroenterologist for further evaluation.
In both the cases you should maintain adequate hydration and salts in your body taking water , juices , to avoid dehydration