delete student

 avatar
user_9960396
plain_text
23 days ago
452 B
6
Indexable
Never
<?php
include "db/db_connection.php";

if (isset($_GET['id'])) {
    $studID = $_GET['id'];
    $sql = "DELETE FROM tbl_Student WHERE StudID = ?";
    $params = array($studID);
    $stmt = sqlsrv_query($conn, $sql, $params);
    if ($stmt === false) {
        die(print_r(sqlsrv_errors(), true));
    }
    header("Location: index.php");
    exit();
} else {
    echo "No student ID provided!";
    exit();
}

sqlsrv_close($conn);
?>
Leave a Comment