<?php
$conn=new MySQLi("localhost","rishtadepot_new","Sailor@#321","rishtadepot_live");

if (isset($_GET['id'])) {
    $id = $_GET['id'];

    $sql = "DELETE FROM sub_caste WHERE id = $id";

    if (mysqli_query($conn, $sql)) {
        header('Location: manage-sub-caste.php');
        exit();
    } else {
        echo "Error deleting record: " . mysqli_error($conn);
    }
} else {
    echo "ID not provided.";
}

mysqli_close($conn); 
?>