diff --git a/MysqliDb.php b/MysqliDb.php index aa099b00..5988a5b9 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -1469,8 +1469,9 @@ protected function _buildLimit($numRows) protected function _prepareQuery() { if (!$stmt = $this->mysqli()->prepare($this->_query)) { + $msg = "Problem preparing query ($this->_query) " . $this->mysqli()->error; $this->reset(); - throw new Exception("Problem preparing query ($this->_query) " . $this->mysqli()->error); + throw new Exception($msg); } if ($this->traceEnabled) {