Answers for "html button delete row from mysql"

PHP
0

html button delete row from mysql

<?php

include "dbConn.php"; // Using database connection file here

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

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

if($del)
{
    mysqli_close($db); // Close connection
    header("location:all_records.php"); // redirects to all records page
    exit;	
}
else
{
    echo "Error deleting record"; // display error message if not delete
}
?>
Posted by: Guest on May-30-2020

Browse Popular Code Answers by Language