Sometimes magnesium can help muscle cramping, but DON'T take supplements, you won't know how well these are absorbed or what imbalances they could set up. Instead, you can absorb some extra magnesium through Epsom salt baths. Put 2 cups of Epsom salts in a tub of warm water, add 1 cup of baking soda (so your skin won't itch), and soak yourself for half an hour at least. There was a British study that showed 200mg of magnesium was absorbed in 20 minutes in a bath. If that helps, you're on the right track.
It seems less likely it might be potassium, but if so that can be corrected by eating more high-potassium foods (bananas, etc.) My Mom had a low potassium level in her blood work and she corrected it by focusing on potassium-rich foods for a few weeks. She's had no problems since.
If the baths help, then you might consider what conditions might be draining you of magnesium...i.e., any prescription drugs, coffee, an undiagnosed illness, perhaps just digestive issues? If so, probiotics might help your gut and get you better absorption in the long run.
I deal with muscle cramps and pain quite a bit due to my Lyme disease. The baths are a big help, meanwhile treating the bacteria and taking care of other health issues related to the illness.
10th yr on program: age=58, BMI=18, b/p=110/70, tc=126, McD=100%.
diagnosed with lyme disease March 2010