Farting means food is fermenting in your guts, producing those gas. The root cause could be:
1. You could be intolerant to certain food e.g lactose intolerance therefore undigested lactose from milk will be fermented by bacteria in your gut
2. Undigested food (gets fermented) due to lack of enzymes. You then need enzymes supplements.
3. Candidiasis - fungal infection in the gut. If you get gassy within minutes after eating, it could be a sign of fungus overgrowth. Fungus rely on sugars/ carbohydrates to thrive, but will die off when eating low-carbohydrate meals. The cure is to follow a low-carb diet and take 2 spoonful of Caproil (or any other source of caprylic acids) on empty stomach with psyllium fiber - 1 spoonful of psyllium will turn a glass of water into a gel, which swells up in the intestine, effectively coating the intestinal wall with the Caproil and killing all those nasty candida fungus. It's very effective, you maybe fart free on the 2nd day.
For those who needs a reprieve from chronic farting, just go low carb. No sugar, pasta, bread, starchy food. Eat protein and good fats (olive oil, avocado, coconut oil). Protein and fats cannot be fermented in the intestines, therefore no gas.