quot;Commands out of sync; you can#39;t run this command nowquot; - Caused by mysqli::multi_query(quot;命令不同步;你现在不能运行这个命令- 由 mysqli::multi_query 引起)
问题描述
我正在通过 mysqli::multi_query
运行多个删除操作,但它搞乱了下一个查询.正在抛出以下错误.
I am running multiple deletes through mysqli::multi_query
and it is messing up the next query in line. The following error is being thrown.
我是否需要以某种方式清除多查询,以免干扰我的下一个查询?这个错误的原因是什么?
Do I need to somehow clear the multi query so it doesn't mess with my next query? What is the cause of this error?
这就是我运行多查询的方式:
And this is how I am running my multi query:
我在 Windows 7 上使用最新版本的 Xampp
I am using a recent version of Xampp on windows 7
推荐答案
这帮助我消除了命令不同步"错误:
This helped me to remove 'Commands out of sync' error:
在调用 multi_query 后添加这段代码,它将使用结果集并解决错误.
Add this code just after calling multi_query, it will use the result sets and resolve the error.
这篇关于"命令不同步;你现在不能运行这个命令"- 由 mysqli::multi_query 引起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!