X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdba_pdo.php;h=7b720fb6c1217e31be5ae0368ea9facbdfcf229e;hb=3af7cff281d0a0af6759340684adb75723b34071;hp=2f1309b9a2bea565a18b1cc28ae592faf3f7105a;hpb=1a5da0ae60b2be930e4cd76b28e34aeb550935f0;p=friendica.git diff --git a/include/dba_pdo.php b/include/dba_pdo.php index 2f1309b9a2..7b720fb6c1 100644 --- a/include/dba_pdo.php +++ b/include/dba_pdo.php @@ -100,7 +100,7 @@ class dba { public function q($sql, $onlyquery = false) { global $a; - + $strHandler = (true === $onlyquery) ? 'PDOStatement' : 'MULTI'; $strQueryAlias = md5($sql); @@ -126,6 +126,7 @@ class dba { # bad workaround to emulate the bizzare behavior of mysql_query if(in_array($strSQLType, array('INSERT', 'UPDATE', 'DELETE', 'CREATE', 'DROP', 'SET'))) $result = true; + $intErrorCode = false; } catch (\Exception $objException) { $result = false; @@ -181,13 +182,13 @@ class dba { * These usually indicate SQL syntax errors that need to be resolved. */ - if($result === false) { + if(isset($result) AND ($result === false)) { logger('dba: ' . printable($sql) . ' returned false.' . "\n" . $this->error); if(file_exists('dbfail.out')) file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND); } - if(($result === true) || ($result === false)) + if(isset($result) AND (($result === true) || ($result === false))) return $result; if ($onlyquery) {