Commands out of sync; you can't run this command now while calling stored procedure in Mysql Commands out of sync; you can't run this command now while calling stored procedure in Mysql codeigniter codeigniter

Commands out of sync; you can't run this command now while calling stored procedure in Mysql


So you need to deal with the extra result sets generated by the stored procedure. The mysqli driver provides a method for this, but CodeIgniter may not make that method available.

From https://ellislab.com/forums/viewthread/73714/#562711:

I simply added the following into mysqli_result.php that is missing this command for some strange reason. (under /system/database/drivers/mysqli/mysqli_result.php)

// --------------------------------------------------------------------  /**   * Read the next result   *   * @return  null   */     function next_result()  {    if (is_object($this->conn_id))    {      return mysqli_next_result($this->conn_id);    }  }  // -------------------------------------------------------------------- 

Then in my model, I simply call $result->next_result() to loose the expected extraneous resultset.