Advertisement
arijulianto

user-hapus.php

Feb 15th, 2023
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2. if(isset($_GET['id']) && !empty($_GET['id'])){
  3.     include 'koneksi.php';
  4.  
  5.     $id = (int) $_GET['id'];
  6.  
  7.     $res = $db->prepare("DELETE from user WHERE iduser=?");
  8.     $res->bind_param('s', $_GET['id']);
  9.     if($res->execute()){
  10.         echo "<script>alert('Data berhasil dihapus');location.href='web.php?p=user';</script>";
  11.     }else{
  12.         echo '<p>Data gagal dihapus</p>';
  13.     }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement