0){ $sql = "UPDATE trfstandards SET idprotectioncategory='" . $input['idprotectioncategory'] . "'" ." , iddpicategory='" . $input['iddpicategory'] . "'" ." WHERE idtrfstandards='" . $input['id'] . "'"; mysqli_query($con,$sql); } else { $sql = "INSERT INTO trfstandards SET idtrfdetails ='" . $input['idtrfdetails'] . "', idstandards='" . $input['idstandards'] . "'" ." , idprotectioncategory='" . $input['idprotectioncategory'] . "'" ." , iddpicategory='" . $input['iddpicategory'] . "'"; } mysqli_query($con,$sql); } if ($input['action'] === 'delete') { mysqli_query($con,"DELETE FROM trfstandards WHERE idtrfstandards='" . $input['id'] . "'"); } //mysqli_close($mysqli); echo json_encode($input); ?>