safe_query_fetch() ted nemusi byt fatalni
authorThomas Mudrunka <tomas@mudrunka.cz>
Sun, 29 Jul 2012 19:09:02 +0000 (21:09 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Sun, 29 Jul 2012 19:09:02 +0000 (21:09 +0200)
index.php

index 94d800268479350da856fd6a0ac8a2d25ebcbcd1..2f92066682e8a62a4a1ac4fea6cd9b3929a6f329 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -727,7 +727,9 @@ class Sklad_DB extends PDO {
        }
 
        function safe_query_fetch($sql, $fatal=true, $fetch_flags = PDO::FETCH_ASSOC, $translate=true) {
        }
 
        function safe_query_fetch($sql, $fatal=true, $fetch_flags = PDO::FETCH_ASSOC, $translate=true) {
-               $result = $this->safe_query($sql, $fatal)->fetchAll($fetch_flags);
+               $result = $this->safe_query($sql, $fatal);
+               if(!$fatal && !$result) return $result;
+               $result = $result->fetchAll($fetch_flags);
                $this->load_backend_data_to_query_results($result);
                if($translate) $this->translate_query_results($result);
                return $result;
                $this->load_backend_data_to_query_results($result);
                if($translate) $this->translate_query_results($result);
                return $result;
This page took 0.127238 seconds and 4 git commands to generate.