mnaufaldillah

hapus tugas php

Dec 6th, 2021 (edited)
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2.     include('config.php');
  3.  
  4.     if ( !isset($_GET['id']) ) {
  5.         header('Location: list-siswa.php');
  6.     }
  7.  
  8.     //ambil data dari url
  9.     $id = $_GET['id'];
  10.     $sql = 'DELETE FROM calon_siswa WHERE id='.$id;
  11.     $query = mysqli_query($db_connection, $sql);
  12.  
  13.     if ($query) {
  14.         header('Location: list-siswa.php?status=sukses-hapus');
  15.     }else {
  16.         header('Location: list-siswa.php?status=gagal-hapus');
  17.     }
  18. ?>
Add Comment
Please, Sign In to add comment