The JSON output depends on how your array is structured – so you can change the line inside the while loop to say

$emparray[“Customers”][] = $row;

Then each individual record will go into a new element inside the Customers index in the array, and when you json_encode() it, you’ll get the structure you mentioned. Hope that makes sense …