The compound formed was MgCl₂.
The equation is Mg + ZnCl₂ → ?
This looks a single replacement reaction.
So the products are probably Zn and magnesium chloride.
Mg + ZnCl₂ → Zn + magnesium chloride
Cl is in Group 17, so it forms Cl⁻ ions.
Mg is in Group 2, so it forms Mg²⁺ ions.
The formula of the compound is MgCl₂.