Sometimes constipation and sometimes diarrhea may be related to gastrointestinal dysfunction, intestinal flora imbalance, diet and other factors, and can be treated according to the cause. The commonly used clinical treatments include medication and dietary adjustments. 1. Gastrointestinal dysfunction: Gastrointestinal dysfunction can lead to abnormal digestion and absorption in the gastrointestinal tract, which can cause constipation, diarrhea and other symptoms, and medicines can be taken to regulate gastrointestinal function as prescribed by the doctor, such as domperidone, itopride and so on. 2. Intestinal flora imbalance: intestinal flora imbalance, the body’s beneficial flora decrease, harmful flora increase, affecting the normal digestion and absorption of food, can lead to sometimes constipation and sometimes diarrhea, can be prescribed to take intestinal probiotics, such as bifidobacteria, lactobacillus and so on. 3. Diet: usually unhealthy eating habits, like to eat greasy stimulating food, do not often eat fruits and vegetables and other foods, will affect the gastrointestinal tract peristalsis, may also lead to constipation, diarrhea alternately. Usually pay attention to three regular meals, light diet, appropriate supplement rich in dietary fiber food. Sometimes constipation and sometimes diarrhea may also be related to other causes, you need to go to the hospital as soon as possible to identify the cause of the disease and receive treatment for the cause.