<?php  
include 'include/connection.php';
$id=$_GET['id'];
$sql = "DELETE FROM project WHERE id = '$id'";
$q=mysqli_query($con,"SELECT image from project where id='$id'");
$s=mysqli_fetch_array($q);
$img=$s['image'];
$Path = '../assets/images/projects/'.$img;
if(mysqli_query($con, $sql)){
    session_start();
    unlink($Path);
   $_SESSION['status'] = "Product Deleted Successfully";
   $_SESSION['status_code'] = "success";
    header("location:project.php");
   //  echo "Success";
    }else{
       // echo "<p style='color:red;text-align:center;margin:10px 0px;'>Can't Delete the User Record.</p>";
       $_SESSION['status'] = "Can't Delete the Product.";
       $_SESSION['status_code'] = "error";
       header("location:project.php");
       }
   mysqli_close($conn);
 ?>
 
 
?>