<?php
include 'koneksi.php';

$id = $_GET['id'];

$data = mysqli_query($koneksi,"
    SELECT * FROM berita
    WHERE id='$id'
");

$d = mysqli_fetch_array($data);

unlink("img/".$d['gambar']);

mysqli_query($koneksi,"
    DELETE FROM berita
    WHERE id='$id'
");

header("Location: edit_berita.php");
?>