function DoktorProfilSil(Doktor $doktor) { $bilgi = '<p style="color: red;">Veriler Silinmedi</p>'; try { $baglanti = new VeriTabaniBaglanti(); $conn = $baglanti->pdo_baglanti(); $sil = $conn->prepare("delete d, k from doktor as d,kullanicigiris as k where d.id=? and d.email=? and k.email=d.email"); $sonuc = $sil->execute(array($doktor->getDoktorId(), $doktor->getEmail())); if ($sonuc) { echo $bilgi = '<p style="color: green;">Veriler Silindi</p>'; header("refresh:1;url=../doktorekle.php"); } else { echo $bilgi = '<p style="color: red;">Veriler Silinemedi.</p>'; } } catch (Exception $ex) { $bilgi = '<p style="color: red;">Hata Oluştu: ' . $ex->getMessage() . '</p>'; } finally { if ($conn != null) { $conn = $baglanti->pdo_sonlandir(); } } return $bilgi; }