Created
August 23, 2017 07:33
-
-
Save senocak/1166913f78730293b60a74f61443ca95 to your computer and use it in GitHub Desktop.
PDO and verot.net class upload delete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function sil($tablo,$id){ | |
$eski_resim=""; | |
$query = $this->db->query("SELECT * FROM $tablo where id='$id'")->fetch(PDO::FETCH_ASSOC); | |
if ($query){ | |
$eski_resim=$query["resim"]; | |
} | |
unlink("../images/$tablo/$eski_resim"); | |
$stmt = $this->db->prepare("DELETE FROM $tablo WHERE id = :id"); | |
$stmt->bindParam(':id', $id, PDO::PARAM_INT); | |
$sil =$stmt->execute(); | |
if ($sil){ | |
print "Silme Başarılı."; | |
echo "<script language='javascript'>location.href='index.php?sayfa=".$tablo."';</script>"; | |
} | |
} |
Author
senocak
commented
Aug 23, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment