<?php
include 'config.php';

// Check if 'id' parameter is sent via POST
if (!isset($_POST['id'])) {
    echo "ID parameter is required";
    exit;
}

$id = intval($_POST['id']); // নিরাপদে integer হিসেবে নেওয়া

// Prepared statement for deletion
$stmt = $conn->prepare("DELETE FROM ShuvoPays WHERE id = ?");
$stmt->bind_param("i", $id);

if ($stmt->execute()) {
    if ($stmt->affected_rows > 0) {
        echo "Row deleted successfully";
    } else {
        echo "No row found with this ID";
    }
} else {
    echo "Error deleting row: " . $stmt->error;
}

$stmt->close();
$conn->close();
?>