<?php 
include '../koneksi.php';
$id = $_GET['id'];

mysqli_query($koneksi, "delete from tbl_pasien where id_pasien='$id'");

$data = mysqli_query($koneksi, "select * from tbl_pasien where id_pasien='$id'");
while($d=mysqli_fetch_array($data)){
	$id_pasien = $d['id_pasien'];

	mysqli_query($koneksi,"delete from tbl_pasien where id_pasien='$id_pasien'");
}

mysqli_query($koneksi, "delete from tbl_pasien id_pasien='$id'");

header("location:pasien.php");