Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2. // pemanggilan config.php untuk mengkoneksikan ke database yang sudah di buat
  3. include("config.php");
  4.  
  5. if (isset($_GET["id"])) {
  6.  
  7. $id = $_GET["id"];
  8.  
  9. //jalankan query DELETE untuk menghapus data
  10. $query = "DELETE FROM nama_pancaker WHERE id='$id' ";
  11. $hasil_query = mysqli_query($db, $query);
  12.  
  13. //periksa query, apakah ada kesalahan
  14. if(!$hasil_query) {
  15. die ("Gagal menghapus data: ".mysqli_errno($db).
  16. " - ".mysqli_error($db));
  17. }
  18. }
  19. // meredirect ke halaman index.php
  20. header("location:index.php");
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement