mysql的CR_COMMANDS_OUT_OF_SYNC错误
2009-11-19 12:53
381 查看
mysql执行sql语句时有时会出现CR_COMMANDS_OUT_OF_SYNC错误(2014)
提示语为
commands out of sync; you can't run this command now
网上对此错误的描述很少,而且没有给出解决方法。
其实这是因为上一个sql执行返回了多个结果集,但没有把结果都取出来,就执行了新的sql语句,就会产生这个错误。
应在sql语句执行后
用mysql_store_result(&ninghao79);取出结果集,
然后用mysql_next_result(&ninghao79);检查是否有剩余结果集,
如果有就再用mysql_store_result(&ninghao79);把剩余结果集取出来。
这样就能解决CR_COMMANDS_OUT_OF_SYNC错误了。
转自:http://blog.sina.com.cn/s/blog_4e45516601000b9x.html
提示语为
commands out of sync; you can't run this command now
网上对此错误的描述很少,而且没有给出解决方法。
其实这是因为上一个sql执行返回了多个结果集,但没有把结果都取出来,就执行了新的sql语句,就会产生这个错误。
应在sql语句执行后
用mysql_store_result(&ninghao79);取出结果集,
然后用mysql_next_result(&ninghao79);检查是否有剩余结果集,
如果有就再用mysql_store_result(&ninghao79);把剩余结果集取出来。
这样就能解决CR_COMMANDS_OUT_OF_SYNC错误了。
转自:http://blog.sina.com.cn/s/blog_4e45516601000b9x.html
相关文章推荐
- MySQL的CR_COMMANDS_OUT_OF_SYNC---Error2014
- mysql 2014 error (2014) 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的2014错误解决,CR_COMMANDS_OUT_OF_SYNC错误
- MySql: ”Commands out of sync“Error (Connect/C++)
- PHP 开发中遇到的 Commands out of sync; you cant't run this command now 错误 解决方法
- PHP+MySQL连续插入数据报错:Commands out of sync; you can't run this command now & 读取Excel数据并批量插入到数据中
- 使用otl,报错:mysql Commands out of sync; you can't run this command now
- 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
- Commands out of sync; you can't run this command now错误
- LR错误: Commands out of sync; you can't run this command now 解决方法
- _mysql_exceptions.ProgrammingError:(2014, "commands out of sync; you can't run this command now")
- python mysql 2014 Commands out of sync; you can't run this command now
- Mysql问题一则:Commands out of sync
- 【转】Linux下使用C语言连接Mysql (commands out of sync, you can't run ...)
- python mysql 2014 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解决方案
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now 问题的解决
- mysql 出现 Commands out of sync; you can't run this command now