function DoktorGuncelle(Doktor $doktor) { $bilgi = '<p style="color: red;">Bilgiler Günclenmedi</p>'; try { $baglanti = new VeriTabaniBaglanti(); $conn = $baglanti->pdo_baglanti(); $guncelle = $conn->prepare("update doktor set ad=?, soyad=?, email=?, tel=?, dogumTarihi=? where id=?"); $sonuc = $guncelle->execute(array($doktor->getAd(), $doktor->getSoyad(), $doktor->getEmail(), $doktor->getTel(), $doktor->getDogumTarihi(), $doktor->getDoktorId())); if ($sonuc) { echo $bilgi = '<p style="color: green;">Bilgiler Güncellendi</p>'; header("refresh:1;url=../doktorekle.php"); } else { echo $bilgi = '<p style="color: red;">Hata Oluştu</p>'; } } catch (Exception $ex) { echo $bilgi = '<p style="color: red;">Hata Oluştu: ' . $ex->getMessage() . '</p>'; } finally { if ($conn != null) { $conn = $baglanti->pdo_sonlandir(); } } //return $bilgi; }