error) { die("Failed to connect to the database: " . $conn->error); } $sql = "SELECT * FROM Titama WHERE id=$id"; $res = $conn->query($sql); $course = $res->fetch_assoc(); if(isset($course)){ echo json_encode(true); } else { echo json_encode(false); } include './closedb.php'; ?>