Cevaplarınız için teşekkür ederim beyler sorunu şu şekilde çözdüm:
if ($_GET['urunsil']=="ok") {
kontrolet ();
$sil=$db->prepare("DELETE from urun where urun_id=:urun_id");
$kontrol=$sil->execute(array(
'urun_id' => $_GET['urun_id']
));
if ($kontrol) {
$urunfotosor=$db->prepare("select * from urunfoto where urun_id=:urun_id");
$urunfotosor->execute(array(
'urun_id' => $_GET['urun_id']
));
while($urunfotocek=$urunfotosor->fetch(PDO::FETCH_ASSOC)) {
$resimsilunlink=$urunfotocek['urunfoto_resimyol'];
unlink("../../$resimsilunlink");
}
$resimlerisil=$db->prepare("DELETE from urunfoto where urun_id=:urun_id");
$bak=$resimlerisil->execute(array(
'urun_id' => $_GET['urun_id']
));
Header("Location:../production/urun.php?durum=ok");
} else {
Header("Location:../production/urun.php?durum=no");
}
}