<?php
include 'koneksi.php';

$id = mysqli_real_escape_string($koneksi, $_POST['id']);

$query = "DELETE FROM $nama_tabel WHERE id='$id'";

if(mysqli_query($koneksi, $query)) {
    echo "Data berhasil dihapus!";
} else {
    echo "Gagal menghapus data: " . mysqli_error($koneksi);
}
?>