Not bad advice, and odds are the water or poorly washed vegetables/fruit will be far more likely to cause the condition than cooking with coconut oil. Literally dozens of common products in the US and Europe are laden with coconut oil.
By whatever name, Delhi Belly, Montezuma's Revenge, the Aztec Quickstep, Green Apple Squitters, Calf Scours, Ganges Gurgle, or as spoken of the the financial world, a Liquidity Crisis not due to a poor cash position, the condition attacks some bellies more quickly and desperately than others, while other folks wander through life unaffected.
The major problem arising from the "condition" is dehydration, the same side issue that kills more infants world wide than all of mankind's infectious diseases combined. Personally, with a good bit of time in the tropics, I've always subscribed to traditional remedies, bananas and white rice, and enormous doses of tea with sugar and lemon or lime.