Files
luthfihadinugroho79 e950468760 add files
2026-06-10 19:42:59 +07:00

21 lines
411 B
PHP

<?php
include 'koneksi.php';
header('Content-Type: text/plain; charset=utf-8');
$id = mysqli_real_escape_string($koneksi, $_POST['id'] ?? '');
if (!$id) {
echo "Gagal: ID tidak ditemukan!";
exit;
}
$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);
}
?>