Home >Database >Mysql Tutorial >想用mysql_fetch_row搜索下一行,就删除

想用mysql_fetch_row搜索下一行,就删除

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:42:511171browse

mysqlfetchfreedeletec++

每次通过

<code>str.Format(_T("%s"),row[0]);row=mysql_fetch_row(result);</code>

得到str,然后用

<code>strSQL.Format("delete from mytable where name=\'%s\'",str);if(mysql_real_query(&mysql,(char*)(LPCTSTR)strSQL,(UINT)strSQL.GetLength())!=0){AfxMessageBox("删除失败");}</code>

这样删除表中内容,为什么一直都是删除失败,如果加上释放内存

<code> mysql_free_result(result);</code>

只能删除一次,有没有什么好方法可以一直删除下去。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn