gpt4 book ai didi

代码点火器 : Commands out of sync; you can't run this command now

转载 作者:行者123 更新时间:2023-12-01 06:57:00 35 4
gpt4 key购买 nike

我应用了所有可能的答案,但仍然是同样的问题。
也试过

$this->db->reconnect();

我的查询没有问题

enter image description here

我的代码:
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

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

然后在调用存储过程时在模型中
$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;

关于代码点火器 : Commands out of sync; you can't run this command now,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43232250/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com