Delete data from MySQL #
<?php
require_once('db.php');
if(isset($_GET['id'])){
$id = $_GET['id'];
$sql = "DELETE FROM `product` WHERE id = $id";
if($con->query($sql) === TRUE){
header('Location: http://localhost/crud/show.php');
}else{
echo "something went wrong";
}
}else{
// redirect to show with error
die('id not provided');
}
?>