<?php
include("auth.php");
include("config/db.php");

$id = (int)$_GET['id'];

$q = mysqli_query($conn, "SELECT image FROM testimonials WHERE id=$id");
$row = mysqli_fetch_assoc($q);

@unlink("uploads/testimonials/".$row['image']);

mysqli_query($conn, "DELETE FROM testimonials WHERE id=$id");

header("Location: testimonials.php");
