Advertisement
ridyko

Buat file delete.php untuk menghapus data pengguna.

Jul 29th, 2024
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2. include 'db.php';
  3.  
  4. $id = $_GET['id'];
  5.  
  6. $sql = "DELETE FROM users WHERE id=$id";
  7.  
  8. if ($conn->query($sql) === TRUE) {
  9.     echo "Record deleted successfully";
  10. } else {
  11.     echo "Error deleting record: " . $conn->error;
  12. }
  13.  
  14. $conn->close();
  15. header("Location: index.php");
  16. ?>
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement