"Don't go swimming for an hour after you eat" is actually a good piece of advice. If you do hop into the pool or the ocean right after you eat, you could develop cramps and risk drowning. Let's look at how this works.
The key to understanding why this is risky is to know that your body will always work to take care of its energy needs and that conflicting needs can cause problems. When you exercise, your sympathetic nervous system, a part of the automatic or autonomic nervous system (brainstem, spinal cord) stimulates the nerves to your heart and blood vessels. This nervous stimulation causes those blood vessels (arteries and veins) to contract or constrict (vasoconstriction). This vasoconstriction increases the resistance of the blood vessels in those tissues and reduces blood flow to those tissues. Working muscle also receives the command for vasoconstriction, but the metabolic byproducts produced within the muscle override this command and cause vasodilation. So if most of your body is getting the message to cut the blood flow and your muscles are getting the message to boost the blood flow, the blood that would have gone to some of your organs will go instead to your muscles. Your body is taking from one part to give to another part, but it's OK if the organs that are getting less blood, such as your stomach or your kidneys, are not working.
But what if one of those organs does need the blood to do its work? If you have just eaten, then the food in your stomach begins to be digested. This requires a greater blood supply to the stomach and intestines. Like metabolic byproducts in working muscle, the presence of food in the stomach overrides the commands by the nervous system to constrict the blood vessels in the stomach and intestines. Now you have a situation where the digestive system and working muscle both have increased demands for blood flow and are competing for the increased blood supply. What happens is that neither system gets enough blood flow to meet its needs and the tissues begin to cramp. This presents a serious problem if you are in the water and increases your risk of drowning. If you wait about an hour to allow some digestion to occur and food to leave your stomach, then your risk of cramps goes down.
Here are some interesting links: