Answers for "how to delete data from database in php using button"

SQL
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
1

how to delete data from database in php

TRUNCATE TABLE [table_name]
Posted by: Guest on June-12-2021

Code answers related to "how to delete data from database in php using button"

Code answers related to "SQL"

Browse Popular Code Answers by Language