DELETE PAGE

 DELETE.PHP

<?php

include "conn.php"// Using database connection file here

$id = $_GET['id']; // get id through query string

$del = mysqli_query($db,"delete from ab where id = '$id'"); // delete query

if($del)
{
    mysqli_close($db); // Close connection
    header("location:list.php"); // redirects to all records page
    exit;   
}
else
{
    echo "Error deleting record"// display error message if not delete
}
?>                                          

Comments

Popular posts from this blog

TO DO LIST (PHP)

LOGIN PAGE

FETCH DATA BY ID IN TEXTBOX FROM DATABASE IN PHP MYSQL (SEARCH)