Middle-aged people should consider taking magnesium supplements to protect their bones