c++访问mysql怎么样回滚事物

MySql 码拜 8年前 (2016-02-09) 771次浏览
mysql_autocommit(con,0);
	sprintf_s(tmp, "insert into platid(platid, platname) values(12389, "hmz hello!");");
	rt=mysql_real_query(con,tmp,strlen(tmp));
	if (rt)
	{
		printf("Error making query: %s !!!\n",mysql_error(con));
	} 
	else
	{
		printf("%s executed!!!\n",tmp);
	}
	mysql_rollback(con);

不知道为什么,没有回滚的效果

解决方案

10

直接执行 rollback

10

auto commit  状态是什么?

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明c++访问mysql怎么样回滚事物
喜欢 (0)
[1034331897@qq.com]
分享 (0)