Skip to content

Loading…

Fixed error when using MySQL stored procedures #436

Closed
wants to merge 1 commit into from

2 participants

@mcrumley

Added rudimentary support for stored procedures in the mysqli database driver.

Prevents "Commands out of sync; you can't run this command now" errors when running

$this->db->query('call StoredProc(...)');
@narfbg narfbg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2011
  1. @mcrumley
Showing with 5 additions and 0 deletions.
  1. +5 −0 system/database/drivers/mysqli/mysqli_driver.php
View
5 system/database/drivers/mysqli/mysqli_driver.php
@@ -177,6 +177,11 @@ function _execute($sql)
{
$sql = $this->_prep_query($sql);
$result = @mysqli_query($this->conn_id, $sql);
+ while ( mysqli_more_results($this->conn_id) ) {
+ mysqli_next_result($this->conn_id);
+ $temp = mysqli_use_result($this->conn_id);
+ if ($temp) mysqli_free_result($temp);
+ }
return $result;
}
Something went wrong with that request. Please try again.