prepare($query)) {
// Bind the Retake_ID to the prepared statement
$stmt->bind_param("i", $Retake_ID);
// Execute the query
if ($stmt->execute()) {
// Successfully deleted the record
echo 'Retake deleted successfully';
exit;
} else {
// Query failed, handle the error
echo 'Error deleting record: ' . $stmt->error;
}
// Close the statement
$stmt->close();
} else {
// Prepare failed, handle the error
echo 'Error preparing statement: ' . $mysqli->error;
}
} else {
// Retake_ID is not set in the POST request
echo 'Retake ID not specified';
}
// Close database connection
$mysqli->close();
?>