The type of reaction that will occur with the given compounds is double-replacement where the components of one is replaced by that from another. This is,
K3PO4 + MgCl2 ----> Mg3(PO4)2 + KCl
Balancing the reactant and product sides,
2K3PO4 + 3MgCl2 ---> Mg3(PO4)2 + 6KCl