且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mysql存储过程错误命令不同步;您现在不能运行此命令

更新时间:2023-11-09 11:47:46

在只需用$select_stmt->close();分隔查询即可将它们拆分(不是同时进行的,而是过程性的. 有关此详情,请参见

In Just seperate your queries with $select_stmt->close(); to split them (not simultaneous but procedural. For more on this see

如果您使用的是codeigniter Framework, 将以下代码添加到/system/database/drivers/mysqli/mysqli_result.php 用于代码点火器

If you are using codeigniter Framework, add following code into /system/database/drivers/mysqli/mysqli_result.php For codeigniter

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;