$arr[] = 'Missing parameter in the request : responsibility'; echo json_encode($arr); die; } $involvement = null; if (isset($_POST['involvement']) && !empty($_POST['involvement'])) { $involvement = $_POST['involvement']; } else { header('Content-type: application/json'); $arr = array(); $arr[] = -1; $arr[] = 'Missing parameter in the request : involvement'; echo json_encode($arr); die; } $threethings = null; if (isset($_POST['threethings']) && !empty($_POST['threethings'])) { $threethings = $_POST['threethings']; } else { header('Content-type: application/json'); $arr = array(); $arr[] = -1; $arr[] = 'Missing parameter in the request : threethings'; echo json_encode($arr); die; } $conn = mysqli_connect(SERVER_ADDRESS, USER_NAME, PASSWORD, DATABASE); $result = People::switchCampusAmbassador($anwid, $email, $address, $degree, $graduation, $responsibility, $involvement, $threethings, $conn); mysqli_close($conn); header('Content-type: application/json'); echo json_encode($result);