【发布时间】:2017-05-11 05:47:40
【问题描述】:
我在 codeigniter 中使用 mysql 版本,并将存储过程应用于数据库操作之一,并在运行此之后。我想运行另一个查询。那么如何在存储过程下运行其他查询或关闭连接
收到此错误
Commands out of sync; you can't run this command now
这是附加代码
这是我的存储过程
$ret = $CI->db->query("call test_type($item_id,$test_id)");
now I want to run this query
$query = $CI->db->query("SELECT * FROM testing WHERE testing.test_type in ('" . $test_id . "') AND testing.test_item_id = '" . $item_id . "' ORDER BY testing.test_date DESC LIMIT 1");
提前致谢
【问题讨论】:
-
请出示所有相关代码。
-
这是我的存储过程 $ret = $CI->db->query("call test_type($item_id,$test_id)");现在我想运行这个查询 $query = $CI->db->query("SELECT * FROM testing WHERE testing.test_type in ('" . $test_id . "') AND testing.test_item_id = '" . $item_id 。 "' ORDER BY testing.test_date DESC LIMIT 1");
-
您还应该更新您的问题,而不是在 cmets 中发布其他代码。很不可读。
标签: php mysql codeigniter stored-procedures