Advertisement
ali602

hapus-anggota.php

May 15th, 2024
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | Source Code | 0 0
  1. <?php
  2.  
  3.     include("config.php");
  4.  
  5.     if( isset($_GET['id_anggota']) ){
  6.        
  7.         // ambil id dari query string
  8.         $id = $_GET['id_anggota'];
  9.        
  10.         // buat query hapus
  11.         $sql = "DELETE FROM anggota_perpus WHERE id_anggota=$id";
  12.         $query = mysqli_query($db, $sql);
  13.        
  14.         // apakah query hapus berhasil?
  15.         if( $query ){
  16.             header('Location: list-daftar-anggota.php');
  17.         } else {
  18.             die("Gagal menghapus anggota...");
  19.         }
  20.        
  21.     } else {
  22.         die("akses dilarang...");
  23.     }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement