<?php
include ("connection.php");
$id=$_GET['id'];
$sql="SELECT * FROM `slider` WHERE `id`='$id'";
$query=mysqli_query($con,$sql);
$row=mysqli_fetch_assoc($query);
$old=$row['Image'];
// 2nd sql query
$sql1="DELETE FROM `slider` WHERE `id`='$id'";
$query1=mysqli_query($con,$sql1);
unlink("./assets/images/slider/" .$old);
if($query1){
    header("location: viewslider.php");
}

?>