0) { while ($row = mysqli_fetch_assoc($result)) { // $data[$x] = $row; // $data[]=$row; // $x++; $data[$x]['checkup_form_value'] = $row['hyg_param_val']; $data[$x]['checkup_date'] = date_format(date_create($row['checkup_date']), "d-M-Y"); $x ++; } } else { $data['status'] = 200; $data['message'] = "Data not found!"; } echo json_encode($data); ?>