Welcome Guest, Not a member yet? Register   Sign In
Command out of sync
#1

[eluser]stathis[/eluser]
It seems that when you try to call at 2 stored procedures at the same routine,
you get an error like this: "Command out of sync"

This error is caused due to the fact that mySQL Stored Procedures return MULTI RESULTS
even if there is only one select statement in them.

In PHP, you over come this by using mysqli_multi_query.
In CI, i re-writed funcion _execute, located in system/database/drivers/mysqli/mysqli_driver.php using the following code:

Code:
function _execute($sql)
        {
            $sql = $this->_prep_query($sql);    
            @mysqli_multi_query($this->conn_id, $sql);
            $result = @mysqli_store_result($this->conn_id);        
            if (@mysqli_more_results($this->conn_id)) {
                @mysqli_next_result($this->conn_id);            
            }
            return $result;
    }
Is it possible to find a permanent solution on this?
Please note that the above, leaves out the possibility for one to actually need to have multiple results in one procedure call.


Messages In This Thread
Command out of sync - by El Forum - 03-09-2008, 09:40 AM
Command out of sync - by El Forum - 04-02-2008, 01:57 PM
Command out of sync - by El Forum - 06-16-2008, 10:39 AM
Command out of sync - by El Forum - 04-13-2009, 01:07 AM
Command out of sync - by El Forum - 06-27-2009, 07:52 PM
Command out of sync - by El Forum - 08-08-2011, 06:30 AM
Command out of sync - by El Forum - 08-08-2011, 09:40 PM
Command out of sync - by El Forum - 08-09-2011, 02:58 AM
Command out of sync - by El Forum - 06-05-2014, 04:04 AM
Command out of sync - by El Forum - 06-05-2014, 12:07 PM
Command out of sync - by El Forum - 06-05-2014, 03:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB