Most of the time, doctors never find the cause of persistant hiccups. When a cause is found it is almost always something that irritates or presses on the nerves leading to the heart, lungs or diaphragm, such as a tumor, stomach ulcer, or irregular heart beats.
Your windpipe, which carries air to your lungs, is located just in front of your esophagus, which carries food to your stomach. You certainly don't want food to pass down your windpipe, so it is covered with a trap door called the glottis. The glottis closes when you swallow and prevents food and drink from going into your lungs. The diaphragm is the huge muscle that is situated underneath your lungs. It moves down to pull the lungs down to fill your lungs with air. You get hiccups when the diaphragm suddenly contracts downward to pull the lungs downward and bring air into the lungs, but, before the air can get into your lungs, the glottis, the trap door over the windpipe, suddenly closes, and prevents air from entering the windpipe. Hiccups have no useful function after you are born, but when you were in your mother's womb, your face was under water and you closed your glottis when your diaphragm moved down to prevent water from getting into your lungs.
Everyone has a favorite hiccup remedy: touching a spoon against the uvula repeatedly while you try to breathe in, breathing into a bag, drinking water from the back side of a glass, massaging your neck, pulling on your tongue, sudden fright, pressing on your eyeball, or holding your breath. If none of those work and hiccups persist, doctors may prescribe Baclofen, a drug to reduce nerve messages; Metoclopramide, a drug to make the stomach contract; Chlorpromazine, a drug to tranquilize nerves; or Haldol, a drug used to treat schizophrenia.