设为首页 加入收藏

TOP

MySQL问题一则:Commands out of sync; you can't run this command now以及相关问题 (二)
2015-07-24 10:21:46 来源: 作者: 【 】 浏览:1
Tags:MySQL 问题 一则 :Commands out sync you can' run this command now 以及 相关
ou can't run this command now

?在第一次调用Update()执行多条sql语句时成功,但以后的所有调用都失败了。

经过查找,发现问题在于:在Update()中执行多条sql语句时,

如果仅仅是插入等不需要返回值的SQL语句,也一样得读完整个resault集并释放,最小化的写法:

do

{

??? result = mysql_store_result( mysql );

??? mysql_free_result(result);

}while( !mysql_next_result( mysql ) );

?

经过这么一处理,问题终于解决了。

作者:楚

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇sqlserver、mysql如何获取连接字.. 下一篇BLOB/TEXT column 'descripti..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Python 数据分析与可 (2025-12-26 21:51:20)
·从零开始学Python之 (2025-12-26 21:51:17)
·超长干货:Python实 (2025-12-26 21:51:14)
·为什么 Java 社区至 (2025-12-26 21:19:10)
·Java多线程阻塞队列 (2025-12-26 21:19:07)