Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion MysqliDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ public function setPrefix($prefix = '')
*/
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,
FILTER_FLAG_NO_ENCODE_QUOTES);
$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]);
Expand All @@ -237,6 +237,7 @@ public function rawQuery ($query, $bindParams = null, $sanitize = true)

$stmt->execute();
$this->_stmtError = $stmt->error;
$this->_lastQuery = $this->replacePlaceHolders ($this->_query, $params);
$this->reset();

return $this->_dynamicBindResults($stmt);
Expand Down Expand Up @@ -719,6 +720,9 @@ protected function _dynamicBindResults(mysqli_stmt $stmt)
$this->count++;
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) {
$this->fetchTotalCount = false;
Expand Down