HOW TO DELETE DATA IN MYSQL USING PHP - CULT CODE
In this tutorial, we will learn how to DELETE data in MYSQL using PHP. 1. Create a table name user. Use the code below to create a table: CREATE TABLE `user` ( `id` int(11) NOT NULL, `username` varchar(251) NOT NULL, `email` varchar(251) NOT NULL, `password` varchar(251) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 2. Now create a file connect.php: This file will help us to connect PHP to Mysql. <?php $connect = mysqli_connect("localhost", "root", "password", "demo"); ?> 3. Now create a file index.php: In this file, we will create an HTML form and fetch data using PHP. <?php include('connect.php'); include('delete.php'); $data_query = "SELECT * FROM user LIMIT 1"; $data_result = mysqli_query($connect, $data_query); if(mysqli_num_rows($data_result) > 0) { while($r...