Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-06 09:42:51
Original
1130 people have browsed it

mysqlfetchfreedeletec++

每次通过

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

得到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>
Copy after login

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

<code> mysql_free_result(result);</code>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template