Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost';
- $username = 'root';
- $password = '';
- $database = 'tb';
- // koneksi disimpan kedalam variabel $link
- $link = mysqli_connect($host , $username , $password , $database) or die('Koneksi ke database gagal');
- if (isset($_GET['id'])) {
- $id=$_GET['id'];
- $delete = "DELETE FROM siswa JOIN kelas ON kelas.id_kelas = siswa.kelas JOIN jurusan ON jurusan.id_jurusan = siswa.jurusan JOIN akun ON siswa.nis_siswa = akun.nis WHERE id_siswa = $id";
- if ($link->query($delete) === TRUE) {
- header("location:/index.php");
- } else {
- echo "Error NGEDELETE DATA: " . $link->error;
- }
- }else{
- echo "HOAMMS NGANTUK" . $link->error;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement