codeigniter : 命令不同步;你现在不能运行这个命令 [英] codeigniter : Commands out of sync; you can't run this command now
本文介绍了codeigniter : 命令不同步;你现在不能运行这个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应用了所有可能的答案,但仍然是同样的问题.也试过
I applied all the possible answers but still same problem. also tried
$this->db->reconnect();
我的查询没有问题
我的代码:
public function GetdistributorsDetails($username){
$sql = "SELECT u.FirstName, u.Email, u.Telephone, u.MobileNumber, u.AlternateMobileNumber, ud.Address1, ud.Pincode,ud.City,s.Statename FROM users u JOIN userdetails ud ON ud.UserId = u.UserId JOIN states s ON s.StateId = ud.StateId WHERE u.Username = ? ";
$result = $this->db->query($sql,array($username));
return $result->result_array();
}
推荐答案
在/system/database/drivers/mysqli/mysqli_result.php中加入如下代码
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;
这篇关于codeigniter : 命令不同步;你现在不能运行这个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文