$row['First'] means you will be able to show the first row of your record by referencing data.First later in your jQuery script $data = array ("First"=>$row['First'],"Second"=>$row['Second']); // We encode our array as JSON, as it is easier to process $jsondata = json_encode($data); } // Finally we return the data echo "$jsondata"; ?>