[eluser]CoreyLoose[/eluser]
I wasn't able to get any of the solutions given here to work for me, but I was able to get a hybrid approach to work.
database.php
Code:
$db['default']['dbdriver'] = "mysqli";
query
Code:
$this->load->helper('mysqli');
$result = $this->db->query( 'CALL MyProc(?)', array($parameter) );
print_r( $result->result_array() );
clean_mysqli_connection($this->db->conn_id);
mysqli_helper.php
Code:
function clean_mysqli_connection( $dbc )
{
while( mysqli_more_results($dbc) )
{
if(mysqli_next_result($dbc))
{
$result = mysqli_use_result($dbc);
if( get_class($result) == 'mysqli_stmt' )
{
mysqli_stmt_free_result($result);
}
else
{
unset($result);
}
}
}
}
Until I started using the clean_mysqli_connection function I was getting an error along the lines of 'Commands out of sync; you can't run this command now' whenever I tried to call a procedure a second time.