Delete Data Using PHP Mysqli
<?php
if(isset($_GET['id']))
{
$con=mysqli_connect("localhost","root","root","example") or die(mysqli_error());
$query= 'delete from student_info where id="'.$_GET['id'].'" ' ;
$result = mysqli_query($con,$query);
// $row = mysqli_fetch_array($result);
if($result)
{
echo '<script type="text/javascript">';
echo " alert('Record Deleted');";
echo 'window.location.href = "view.php";';
echo '</script>';
}
}
?>
if(isset($_GET['id']))
{
$con=mysqli_connect("localhost","root","root","example") or die(mysqli_error());
$query= 'delete from student_info where id="'.$_GET['id'].'" ' ;
$result = mysqli_query($con,$query);
// $row = mysqli_fetch_array($result);
if($result)
{
echo '<script type="text/javascript">';
echo " alert('Record Deleted');";
echo 'window.location.href = "view.php";';
echo '</script>';
}
}
?>
Comments
Post a Comment