break; case "service_INS": $validate = new validate(); $data = $validate->services_ins(); $function = new functions(); $data = $function->service_INS($mysqli); break; case "category_SEL": $validate = new validate(); $data = $validate->category_sel(); $function = new functions(); $data = $function->category_SEL($mysqli); break; case "category_INS": $validate = new validate(); $data = $validate->category_ins(); $function = new functions(); $data = $function->category_INS($mysqli); break; default: break; } } else { http_response_code(200); $data['status'] = "error"; $data['success'] = false; $data['message'] = "No method specified"; } // let's send the data back header("Content-Type: application/json"); echo json_encode($data);