?
| Path : /home/u949514618/domains/drpktiwari.com/public_html/admin/ |
| Current File : /home/u949514618/domains/drpktiwari.com/public_html/admin/delete_entry.php |
<?php
include('db.php');
// Check if ID is received
if (isset($_POST['id'])) {
$id = intval($_POST['id']); // Sanitize input
// Delete query
$stmt = $conn->prepare("DELETE FROM lottery_entries WHERE id = ?");
$stmt->bind_param("i", $id);
if ($stmt->execute()) {
echo 'success'; // Respond with success message
} else {
echo 'error'; // Respond with error message
}
$stmt->close();
}
$conn->close();
?>