diff --git a/classes/Db/Query.php b/classes/Db/Query.php index 560ea8fed4..2b5521a111 100644 --- a/classes/Db/Query.php +++ b/classes/Db/Query.php @@ -79,11 +79,11 @@ public function query($sql = "", $params = null) { $pdoStatement->bindValue($paramKey, $paramValue, $paramType); } - $ret = $pdoStatement->execute(); + $pdoStatement->execute(); } else { // Execute the raw query - $ret = $pdoStatement = $this->conn->query($sql); + $pdoStatement = $this->conn->query($sql); } @@ -91,10 +91,14 @@ public function query($sql = "", $params = null) { if ($error and $error != "00000") { error_log("Ruh Roh, $error"); error_log(print_r($pdoStatement->errorInfo(), true)); + ob_start(); + $pdoStatement->debugDumpParams(); + error_log(ob_get_clean()); + error_log(print_r($pdoStatement->errorInfo(), true)); } // Test the query actually worked - if (!$pdoStatement or !$ret) { + if (!$pdoStatement) { $this->error($this->conn->errorCode() . ': ' . $this->conn->errorInfo()[2]); ob_start(); $pdoStatement->debugDumpParams(); @@ -106,7 +110,7 @@ public function query($sql = "", $params = null) { return; } - if ((!$pdoStatement) or (empty($pdoStatement)) or (!$ret)) { + if ((!$pdoStatement) or (empty($pdoStatement))) { // A failed query. $this->success = false;