PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now
2013-04-01 16:36
856 查看
在PHP同一事物里调用MYSQL的存储过程后再次执行另外的一个或多个命令(或者在同一事物里执行多个存储过程),如果使用mysqli的query方法获得结果,将获得一个错误:Commands
out of sync; you can't run this command now
消息说明MYSQL数据库认为是这一个错误的命令执行顺序。原因在于MYSQL的存储过程执行完成后除了返回实际结果集还会返回存储过程执行的转态
,而上面的代码仅处理了第一个结果集,第二个结果集并没有被释放掉。
要解决这个问题,需要用mysqli的multi_query方法
详细可以参考:http://www.cnblogs.com/doll-net/archive/2009/04/29/commands-out-of-sync.html
out of sync; you can't run this command now
消息说明MYSQL数据库认为是这一个错误的命令执行顺序。原因在于MYSQL的存储过程执行完成后除了返回实际结果集还会返回存储过程执行的转态
,而上面的代码仅处理了第一个结果集,第二个结果集并没有被释放掉。
要解决这个问题,需要用mysqli的multi_query方法
详细可以参考:http://www.cnblogs.com/doll-net/archive/2009/04/29/commands-out-of-sync.html
相关文章推荐
- php用mysql_query()调用存储过程后无法再执行sql报错:commands out of sync you can't run this command now
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now 问题的解决
- MySQL一次执行多条语句的实现及常见问题(C API Commands out of sync; you can't run this command now)
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now
- PHP+MySQL连续插入数据报错:Commands out of sync; you can't run this command now & 读取Excel数据并批量插入到数据中
- python mysql 2014 Commands out of sync; you can't run this command now
- LR错误: Commands out of sync; you can't run this command now 解决方法
- error:2014 Commands out of sync; you can't run this command now
- Commands out of sync; you can't run this command now
- 解决error:2014 Commands out of sync; you can't run this command now
- 解决mysql error:2014 Commands out of sync; you can't run this command now
- 解决error:2014 Commands out of sync; you can't run this command now
- 解决error:2014 Commands out of sync; you can't run this command now
- MySQL一次执行多条语句的实现及常见问题(C API Commands out of sync; you can't run this command now)
- C++ Mysql调用 错误:2014 :Commands out of sync; you can't run this command now
- mysql: Commands out of sync; you can't run this command now
- Mysql::Error: Commands out of sync; you can't run this command now: SHOW TABLES解决方案
- mysql 出现 Commands out of sync; you can't run this command now
- Commands out of sync; you can't run this command now SQL
- Commands out of sync; you can't run this command now