【发布时间】:2011-06-15 15:05:54
【问题描述】:
我正在通过mysqli::multi_query 运行多次删除,它正在搞乱下一个查询。抛出以下错误。
Error - SQLSTATE HY000.
Sql error: Commands out of sync; you can't run this command now
我是否需要以某种方式清除多重查询,以免与我的下一个查询混淆?这个错误的原因是什么?
这就是我运行多重查询的方式:
function deleteSomeTables($args) {
$sql = 'delete 1;delete another;';
if ($database->multi_query($sql)) {
return true;
} else {
return false;
}
}
我在 Windows 7 上使用最新版本的 Xampp
【问题讨论】:
标签: php mysqli mysqli-multi-query