MySQL问题一则:Commands out of sync; you can't run this command now以及相关问题 (二)

2015-07-24 10:21:46 ? 作者: ? 浏览: 4
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 ) );

?

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

作者:楚

-->

评论

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