Why do many patients have problems with diarrhea and constipation?

...Are these related to the following: a) digestion, b) type of food eaten, c) muscles not working properly? How can these problems be treated?

Most problems are due to intestinal motility. Selection of foods is important. Appropriate amounts of fiber supplements may be useful, although overuse may produce impaction if the patient becomes constipated. Stool softener and non-irritant laxatives are useful. Cisapride (Propulsid) and other prokinetic drugs should be avoided because of cardiotoxicity.