]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
mysql try catch trie
authorBanana <mail@bananas-playground.net>
Fri, 1 Jan 2021 15:11:30 +0000 (16:11 +0100)
committerBanana <mail@bananas-playground.net>
Fri, 1 Jan 2021 15:11:30 +0000 (16:11 +0100)
webclient/lib/trite.class.php

index 3edfd7d2557792adca69c3825c6a584e124b5948..7a2ea8bf2371037c68c7534598a5b4f1eaec0900 100644 (file)
@@ -165,13 +165,18 @@ class Trite {
                                        LEFT JOIN `".DB_PREFIX."_group` AS g ON `c`.`group` = `g`.`id`
                                        WHERE ".$this->_User->getSQLRightsString("read", "c")."
                                        ORDER BY `c`.`name`";
-               $query = $this->_DB->query($queryStr);
+               try {
+                       $query = $this->_DB->query($queryStr);
 
-               if($query !== false && $query->num_rows > 0) {
-                       while(($result = $query->fetch_assoc()) != false) {
-                               $ret[$result['id']] = $result;
+                       if($query !== false && $query->num_rows > 0) {
+                               while(($result = $query->fetch_assoc()) != false) {
+                                       $ret[$result['id']] = $result;
+                               }
                        }
                }
+               catch (Exception $e) {
+                       error_log("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+               }
 
                return $ret;
        }