<?php
include "../../config/master.php";

$id=$_GET['id'];

$data=mysqli_fetch_assoc(mysqli_query($conn,"SELECT * FROM village_sliders WHERE id='$id'"));

if($data){

$file="../../uploads/sliders/".$data['image'];
if(file_exists($file)) unlink($file);

mysqli_query($conn,"DELETE FROM village_sliders WHERE id='$id'");
}

echo json_encode(["status"=>"deleted"]);