Metabolic abnormalities
Insufficient selenium, vitamin D or sunlight exposure, or vitamin B6. Gastrointestinal causes: the distal digestive tract secretes high levels of magnesium. Therefore, secretory diarrhea can cause hypomagnesemia. Thus, Crohns disease, ulcerative colitis, Whipples disease and celiac sprue can all cause hypomagnesemia. Postobstructive diuresis, diuretic phase of acute tubular necrosis (ATN) and kidney transplant. Other
Acute myocardial infarction: within the first 48 hours after a heart attack, 80% of patients have hypomagnesemia. This could be the result of an intracellular shift because of an increase in catecholamines. Malabsorption
Acute pancreatitis
Fluoride poisoning
Massive transfusion (MT) is a lifesaving treatment of hemorrhagic shock, but can be associated with significant complications. Pathophysiology
Magnesium is a co-factor in over 300 functions in the body regulating many kinds of  biochemical reactions. It is involved in protein synthesis, muscle and nerve functioning, bone development, energy production, the maintenance of normal heart rhythm, and the regulation of glucose and blood pressure, among other important roles. Low magnesium intake over time can increase the risk of illnesses, including high blood pressure and heart disease, diabetes mellitus type 2, osteoporosis, and migraines.There is a direct effect on sodium (Na), potassium (K), and calcium (Ca) channels. Magnesium has several effects:

Potassium
Potassium channel efflux is inhibited by magnesium. Thus hypomagnesemia results in an increased excretion of potassium in kidney, resulting in a hypokalaemia.
Replacement by mouth is appropriate for people with mild symptoms, while intravenous replacement is recommended for people with severe effects.Numerous oral magnesium preparations are available. In two trials of magnesium oxide, one of the most common forms in magnesium dietary supplements because of its high magnesium content per weight, was less bioavailable than magnesium citrate, chloride, lactate or aspartate. Magnesium citrate has been reported as more bioavailable than oxide or amino-acid chelate forms.Intravenous magnesium sulfate (MgSO4) can be given in response to heart arrhythmias to correct for hypokalemia, preventing pre-eclampsia, and has been suggested as having a potential use in asthma. Food
Food sources of magnesium include leafy green vegetables, beans, nuts, and seeds. Epidemiology
The condition is relatively common among people in hospital. History
Magnesium deficiency in humans was first described in the medical literature in 1934. Plants
Magnesium deficiency is a detrimental plant disorder that occurs most often in strongly acidic, light, sandy soils, where magnesium can be easily leached away. Magnesium is an essential macronutrient constituting 0.2-0.4% of plants dry matter and is necessary for normal plant growth. Excess potassium, generally due to fertilizers, further aggravates the stress from magnesium deficiency, as does aluminium toxicity.Magnesium has an important role in photosynthesis because it forms the central atom of chlorophyll. Therefore, without sufficient amounts of magnesium, plants begin to degrade the chlorophyll in the old leaves. This causes the main symptom of magnesium deficiency, interveinal chlorosis, or yellowing between leaf veins, which stay green, giving the leaves a marbled appearance.