Advertisement
Rahardyan

delete

Nov 22nd, 2024
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1. <?php
  2. require 'db.php';
  3.  
  4. $id = (int)$_GET['id'];
  5. $query = "DELETE FROM items WHERE id = $id";
  6.  
  7. if (mysqli_query($conn, $query)) {
  8.     header('Location: index.php');
  9. } else {
  10.     echo 'Gagal menghapus barang: ' . mysqli_error($conn);
  11. }
  12. ?>
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement