Bugfix: When a query fails we mustn't use the result value.

This commit is contained in:
Michael 2017-03-16 09:23:12 +00:00
parent 6fdc219143
commit 58bf1c50af

View file

@ -234,7 +234,9 @@ class dba {
case 'pdo': case 'pdo':
$result = @$this->db->query($sql); $result = @$this->db->query($sql);
// Is used to separate between queries that returning data - or not // Is used to separate between queries that returning data - or not
if (!is_bool($result)) {
$columns = $result->columnCount(); $columns = $result->columnCount();
}
break; break;
case 'mysqli': case 'mysqli':
$result = @$this->db->query($sql); $result = @$this->db->query($sql);
@ -329,7 +331,7 @@ class dba {
} }
} }
if (($result === true) || ($result === false)) { if (is_bool($result)) {
return $result; return $result;
} }
if ($onlyquery) { if ($onlyquery) {