Is there a treatment for diarrhea?

Yes. But which treatment depends on the cause of your diarrhea. There are non-specific treatments like over the counter Imodium (loperamide) which slow the gut down thus limiting symptoms. Other treatments include antibiotics, for bacterial causes of diarrhea, as well as anti-pararsitic, and toxin binding therapies (see c.Difficile diarrhea). That all said, the most important "treatment" is good hydration!