X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdba_pdo.php;h=a44c447af20fa568d8ed15bb6e6082fc5330b182;hb=45d6f6c0a3ab8a0048dfb4fd3b28db065ad3a485;hp=eed9ea1251150e29342a3fe35f8417eaad28073b;hpb=1940905454b311fc5999a0d8020832bb92ee52f5;p=friendica.git diff --git a/include/dba_pdo.php b/include/dba_pdo.php index eed9ea1251..a44c447af2 100644 --- a/include/dba_pdo.php +++ b/include/dba_pdo.php @@ -44,7 +44,7 @@ class dba { public $error = false; function __construct($server,$user,$pass,$db,$install = false) { - global $a; + $a = get_app(); # work around, to store the database - configuration in DDDBL $objDataObjectPool = new \DDDBL\DataObjectPool('Database-Definition'); @@ -99,7 +99,7 @@ class dba { } public function q($sql, $onlyquery = false) { - global $a; + $a = get_app(); $strHandler = (true === $onlyquery) ? 'PDOStatement' : 'MULTI'; @@ -182,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) {