Skip to content

Commit ad68a28

Browse files
committed
Merge pull request #218 from avbdr/master
Bugfixes an features
2 parents 73f33fd + 8a2127c commit ad68a28

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

MysqliDb.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ public function setPrefix($prefix = '')
218218
*/
219219
public function rawQuery ($query, $bindParams = null, $sanitize = true)
220220
{
221+
$params = array(''); // Create the empty 0 index
221222
$this->_query = $query;
222223
if ($sanitize)
223224
$this->_query = filter_var ($query, FILTER_SANITIZE_STRING,
224225
FILTER_FLAG_NO_ENCODE_QUOTES);
225226
$stmt = $this->_prepareQuery();
226227

227228
if (is_array($bindParams) === true) {
228-
$params = array(''); // Create the empty 0 index
229229
foreach ($bindParams as $prop => $val) {
230230
$params[0] .= $this->_determineType($val);
231231
array_push($params, $bindParams[$prop]);
@@ -237,6 +237,7 @@ public function rawQuery ($query, $bindParams = null, $sanitize = true)
237237

238238
$stmt->execute();
239239
$this->_stmtError = $stmt->error;
240+
$this->_lastQuery = $this->replacePlaceHolders ($this->_query, $params);
240241
$this->reset();
241242

242243
return $this->_dynamicBindResults($stmt);
@@ -719,6 +720,9 @@ protected function _dynamicBindResults(mysqli_stmt $stmt)
719720
$this->count++;
720721
array_push($results, $x);
721722
}
723+
// stored procedures sometimes can return more then 1 resultset
724+
if ($this->_mysqli->more_results())
725+
$this->_mysqli->next_result();
722726

723727
if ($this->fetchTotalCount === true) {
724728
$this->fetchTotalCount = false;

0 commit comments

Comments
 (0)