<?php
require 'db_config.php';

// Get the ID from the URL
$id = $_GET['id'];

// Prepare and execute the delete statement
$stmt = $conn->prepare("DELETE FROM sub_user WHERE id = ?");
$stmt->bind_param("i", $id);

if ($stmt->execute()) {
    echo "Sub user deleted successfully";
    header("Location: Disubuser.php"); // Redirect to the main page
} else {
    echo "Error deleting sub user: " . $stmt->error;
}

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