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

前端 未结 4 452
灰色年华
灰色年华 2020-12-06 03:54

I applied all the possible answers but still same problem. also tried

$this->db->reconnect();

there is no problem in my query

<
4条回答
  •  生来不讨喜
    2020-12-06 04:15

    add following code into /system/database/drivers/mysqli/mysqli_result.php

     function next_result()
     {
         if (is_object($this->conn_id))
         {
             return mysqli_next_result($this->conn_id);
         }
     }
    

    then in model when you call Stored Procedure

    $query    = $this->db->query("CALL test()");
    $res      = $query->result();
    
    //add this two line 
    $query->next_result(); 
    $query->free_result(); 
    //end of new code
    
    return $res;
    

提交回复
热议问题