Current Path : /data/web/virtuals/51568/virtual/www/www/editor/ |
Current File : /data/web/virtuals/51568/virtual/www/www/editor/clanek-fotka-odstran.php |
<?php require "../../class/pdoDB.class.php"; $pdo = new pdoDB(); require "../../class/obrazek.class.php"; $id = (isset($_POST["id"])) ? $_POST["id"] : 0; $targetDir = "../../ftp/articles/"; try { $update = "select `fotka` from `clanky` where `id` = :id"; $fotka = $pdo->queryOne($update, Array(':id' => $id)); unlink ($targetDir.$fotka->fotka); $update = "update `clanky` set `fotka` = '' where `id` = :id"; $pdo->execute($update, Array(':id' => $id)); } catch (Exception $e) { $result = $e->getMessage(); } ?>