0) { while ($row = mysqli_fetch_assoc($result)) { $data[$i] = $row; $i++; } } else { $data['status'] = '200'; $data['message'] = "Data not found!"; } error_log("SELECT staff" . print_r($data, true)); echo json_encode($data); } ?>