Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. include('config.php');
  3. if(isset($_GET['id'])){
  4. $id = $_GET['id'];
  5. $cek = mysqli_query($koneksi, "SELECT * FROM WebPrograming2 WHERE id='$id'") or die(mysqli_error($koneksi));
  6. if (mysqli_num_rows($cek) > 0) {
  7. $del = mysqli_query($koneksi, "DELETE FROM WebPrograming2 WHERE id='$id'") or die(mysqli_error($koneksi));
  8. if($del){
  9. echo '<script>alert("Berhasil menghapus data."); document.location="index.php";</script>';
  10. }else {
  11. echo '<script>alert("Gagal menghapus data."); document.location="index.php";</script>';
  12. }
  13. }else {
  14. echo '<script>alert("ID tidak ditemukan di database."); document.location="index.php";</script>';
  15. }
  16. }else {
  17. echo '<script>alert("ID tidak ditemukan di database."); document.location="index.php";</script>';
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement