From: Banana Date: Fri, 1 Jan 2021 15:11:30 +0000 (+0100) Subject: mysql try catch trie X-Git-Tag: 1.0~30 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=502cf2a81510d17fa0cafb4d8af1b869bff96c11;p=bibliotheca-php.git mysql try catch trie --- diff --git a/webclient/lib/trite.class.php b/webclient/lib/trite.class.php index 3edfd7d..7a2ea8b 100644 --- a/webclient/lib/trite.class.php +++ b/webclient/lib/trite.class.php @@ -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; }