assoc_array("SELECT * FROM camp_shuttle JOIN camp_shuttle_type on cst_id = cs_shuttle_id WHERE cs_camp_id = " . $_POST['camp_id']); $shuttle_array = array(); foreach ($shuttle_assoc_array as $shuttle) { $shuttle_array[$shuttle['cst_id']] = $shuttle['cst_name']; } echo json_encode($shuttle_assoc_array); ?>