Commit ad68a287 authored by Alexander Butenko's avatar Alexander Butenko

Merge pull request #218 from avbdr/master

Bugfixes an features
parents 73f33fd1 8a2127c5
...@@ -218,6 +218,7 @@ class MysqliDb ...@@ -218,6 +218,7 @@ class MysqliDb
*/ */
public function rawQuery ($query, $bindParams = null, $sanitize = true) public function rawQuery ($query, $bindParams = null, $sanitize = true)
{ {
$params = array(''); // Create the empty 0 index
$this->_query = $query; $this->_query = $query;
if ($sanitize) if ($sanitize)
$this->_query = filter_var ($query, FILTER_SANITIZE_STRING, $this->_query = filter_var ($query, FILTER_SANITIZE_STRING,
...@@ -225,7 +226,6 @@ class MysqliDb ...@@ -225,7 +226,6 @@ class MysqliDb
$stmt = $this->_prepareQuery(); $stmt = $this->_prepareQuery();
if (is_array($bindParams) === true) { if (is_array($bindParams) === true) {
$params = array(''); // Create the empty 0 index
foreach ($bindParams as $prop => $val) { foreach ($bindParams as $prop => $val) {
$params[0] .= $this->_determineType($val); $params[0] .= $this->_determineType($val);
array_push($params, $bindParams[$prop]); array_push($params, $bindParams[$prop]);
...@@ -237,6 +237,7 @@ class MysqliDb ...@@ -237,6 +237,7 @@ class MysqliDb
$stmt->execute(); $stmt->execute();
$this->_stmtError = $stmt->error; $this->_stmtError = $stmt->error;
$this->_lastQuery = $this->replacePlaceHolders ($this->_query, $params);
$this->reset(); $this->reset();
return $this->_dynamicBindResults($stmt); return $this->_dynamicBindResults($stmt);
...@@ -719,6 +720,9 @@ class MysqliDb ...@@ -719,6 +720,9 @@ class MysqliDb
$this->count++; $this->count++;
array_push($results, $x); array_push($results, $x);
} }
// stored procedures sometimes can return more then 1 resultset
if ($this->_mysqli->more_results())
$this->_mysqli->next_result();
if ($this->fetchTotalCount === true) { if ($this->fetchTotalCount === true) {
$this->fetchTotalCount = false; $this->fetchTotalCount = false;
......
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