Answer
$Mg_{3}(PO_{4})_{2}$
Work Step by Step
A Magnesium (Mg) ion, as the problem states, has a charge of +2 while a Phosphate ($PO_{4})$ ion has a charge of -3. The least common factor between two and three is 6, so the overall charge of Phosphate ions must be -6 while the overall charge of Magnesium ions must be +6, for, in ionic compounds, the overall charge is always neutral. In order to get these charges, there must be three Magnesium ions and two Phosphate ions, hence making the ionic compound $Mg_{3}(PO_{4})_{2}$.