<?php
include('constant/connect.php');

$id = $_GET['id'];
$res = $connect->query("SELECT image FROM doctors WHERE id='$id'");
$row = $res->fetch_assoc();

unlink("assets/uploadImage/".$row['image']);
$connect->query("DELETE FROM doctors WHERE id='$id'");

header("Location: manage_doctors.php");
?>
$res = $connect->query("SELECT image FROM doctors WHERE id='$id'");
$row = $res->fetch_assoc();

unlink("assets/uploadImage/".$row['image']);