Farting when having diarrhea may be caused by intestinal infection, intestinal tumor and improper diet. 1. Intestinal infection: the intestinal tract will produce a lot of pus, blood and mucus after being attacked by microorganisms, which will cause diarrhea, and the intestinal bacteria will decompose the nutrients to produce gas and farting, so diarrhea and farting will occur. 2. Intestinal tumors: Intestinal tumors commonly include rectal cancer and colon cancer, causing intestinal space-occupying lesions, which will cause diarrhea and accompanied by farting phenomenon. 3. Improper diet: Eating a lot of onions, beans and other food with high gas production in normal life, and eating faster will cause diarrhea and farting. When there is farting when diarrhea, it is recommended to go to the hospital for examination, to clarify the cause of the disease and timely symptomatic treatment.