PHP批量删除技巧
来源:互联网 责任编辑:栏目编辑 发表时间:2013-07-01 07:15 点击:次
首先要了解sql语句
$SQL="delete from `PHP100` where id in (1,2,4)";
表单大概是: <form action="" method="post">
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="1"/>
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="2"/>
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="3"/>
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="4"/>
<input type="submit"/>
</form>
php函数主要用到implode
$ID_Dele= implode(",",$_POST['ID_Dele']);
$SQL="delete from `user` where id in ($ID_Dele)";
表单大概是: <form action="" method="post">
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="1"/>
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="2"/>
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="3"/>
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="4"/>
<input type="submit"/>
</form>
php函数主要用到implode
$ID_Dele= implode(",",$_POST['ID_Dele']);
$SQL="delete from `user` where id in ($ID_Dele)";
相关新闻>>
- 发表评论
-
- 最新评论 更多>>