Magnesium citrate, while fairly effective, is used as a laxative, and so can cause D.
According to the following link, the chelated forms are more expensive but best, causing fewer side effects:
magnesium potassium aspartate
chelated magnesium
magnesium glycinate
magnesium malate
http://www.easy-immune-health.com/magnesium-dosage.html
The kind I took, magnesium aspartate, caused D. Don't know what kind my daughter took. The magnesium oxide is supposed to be the least effective.