query($sql) === TRUE) { $stat='success'; } else{ $stat='error'; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode(["userID" =>$mykey]); } $conn->close(); ?>