php删除记录
=============================================
我想删除指定ID号的记录,数据记录主键为“id”,后面的代码怎么写,我写的代码老是删不掉,麻烦大虾们帮个忙。
------解决方案--------------------PHP code<?php #test.phpif(isset($_POST['id2'])){ $sql="delete from table where id=".trim($_POST['id2']); $res = mysql_query($sql); if(!$res) die("SQL:{$sql}<br>Error:".mysql_error()); if(mysql_affected_rows() > 0){ echo "删除成功!<br>"; }else{ echo "查询失败<br>Error:".mysql_error(); }}?>
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