diff --git a/edit-comic.php b/edit-comic.php index c6c36f2..24a1b2c 100644 --- a/edit-comic.php +++ b/edit-comic.php @@ -41,7 +41,8 @@ if( $_POST ) { // get image type and target extension $imagedata = getimagesize($_FILES['comicFile']['tmp_name']); $strip->media = $imagedata[2]; - $fileext = $dbConnection->fetchColumn('SELECT extension FROM media_t WHERE id = ?', array($strip->media), array(PDO::PARAM_INT)); + $fileext = $dbConnection->fetchColumn('SELECT extension FROM media_t WHERE id = ?', array($strip->media), 0, array(PDO::PARAM_INT)); + var_dump($fileext); if(strlen($fileext) < 3) { diff --git a/include/strip.php b/include/strip.php index c85eb05..a313eb3 100644 --- a/include/strip.php +++ b/include/strip.php @@ -22,8 +22,8 @@ class Strip function insertstrip(&$strip) { global $dbConnection; - $strip->book = ($strip->book == '') ? 'NULL' : (int)$strip->book; - $strip->page = ($strip->page == '') ? 'NULL' : (int)$strip->page; + $strip->book = ($strip->book == '') ? NULL : (int)$strip->book; + $strip->page = ($strip->page == '') ? NULL : (int)$strip->page; $dbConnection->beginTransaction(); $newid = $dbConnection->fetchColumn('SELECT MAX(id) FROM strip') + 1;