Commit f68a33d6 authored by Alexander Butenko's avatar Alexander Butenko

Fix #210 empty getLastQuery after rawQuery() execution

parent 76f43dd3
......@@ -218,6 +218,7 @@ class MysqliDb
*/
public function rawQuery ($query, $bindParams = null, $sanitize = true)
{
$params = array(''); // Create the empty 0 index
$this->_query = $query;
if ($sanitize)
$this->_query = filter_var ($query, FILTER_SANITIZE_STRING,
......@@ -225,7 +226,6 @@ class MysqliDb
$stmt = $this->_prepareQuery();
if (is_array($bindParams) === true) {
$params = array(''); // Create the empty 0 index
foreach ($bindParams as $prop => $val) {
$params[0] .= $this->_determineType($val);
array_push($params, $bindParams[$prop]);
......@@ -237,6 +237,7 @@ class MysqliDb
$stmt->execute();
$this->_stmtError = $stmt->error;
$this->_lastQuery = $this->replacePlaceHolders ($this->_query, $params);
$this->reset();
return $this->_dynamicBindResults($stmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment