Delete inline File in PHP

 <?php

echo $stu_id = $_GET["id"];

include "config.php";

$sql = "DELETE FROM student WHERE sid={$stu_id}";

if($conn->query($sql) == TRUE) {
    echo "Record deleted Successfully";
}
else {
    echo "Error deleting record : " . $conn->error;
}
header("Location: http://localhost/crud/index.php");
$conn->close();
?>

Comments

Popular posts from this blog

Update Record File in PHP

Index File in PHP

Edit OR Update Data File in PHP