query($sql) === TRUE) { $stat="Record saved."; } else { $stat="Error, unable to save record."; } } header('Content-Type: application/json'); echo json_encode(["$stat" => "$stat"]); // Close connectio>