Welcome Guest, Not a member yet? Register   Sign In
mysql database error

[eluser]Arun Joshi[/eluser]
I am using mysqli and stored procedure for my database actions in code igniter. But some times I got an error,

Error Number: 2014

Commands out of sync; you can't run this command now.

As suggestions from CI forums I have modified the file 'system/database/drivers/mysqli/mysqli_driver.php'.

I changed _execute($sql) function to

function _execute($sql)
   $sql = $this->_prep_query($sql);

   // get a result code of query (), can be used for test is the query ok
   $retval = @mysqli_multi_query($this->conn_id, $sql);

   // get a first resultset
   $firstResult = @mysqli_store_result($this->conn_id);

   // free other resultsets
   while (@mysqli_next_result($this->conn_id)) {
      $result = @mysqli_store_result($this->conn_id);

   // test is the error occur or not
   if (!$firstResult && [email protected]_errno($this->conn_id)) {
       return true;
   return $firstResult;

Now my problem has solved.

Actually is this the permanent solution? Is there any CI method to solve this issue? I dont like to take risk on this problem. Please answer...

That error message you're getting is a database error. Take a look at this page http://bugs.mysql.com/bug.php?id=28530 and see if that helps, it looks like a bug

Theme © iAndrew 2016 - Forum software by © MyBB