<?php
//$connection = mysqli_connect("localhost","root","");
//$db = mysqli_select_db($connection, 'phpcrud');
$connection = mysqli_connect("analogdepat.mysql.db","analogdepat","Un92pac007");
$db = mysqli_select_db($connection, 'analogdepat');
if(isset($_POST['deletedata']))
{
$id = $_POST['delete_id'];
$query = "DELETE FROM student WHERE id='$id'";
$query_run = mysqli_query($connection, $query);
if($query_run)
{
echo '<script> alert("Data Deleted"); </script>';
header("Location:index.php");
}
else
{
echo '<script> alert("Data Not Deleted"); </script>';
}
}
?>