deletecode File for Delete Data in PHP

 <?php

include("mysqli_conn.php");

if (isset($_POST["deletedata"])) {
    $id = $_POST["delete_id"];

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

    if ($conn->query($sql) == TRUE) {
        echo "<script>alert('Data Deleted');</script>";
        header("Location:index.php");
    } else {
        echo "<script>alert('Data Not Deleted');</script>";
    }
}





Comments

Popular posts from this blog

Index File (with Bootstrap Modal and JavaScript) in PHP