PHP 批量删除 sql语句
时间:2021-10-21 09:10:58|栏目:PHP代码|点击: 次
首先要了解sql语句
$SQL="delete from `jb51` 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)";
https://www.jb51.net/article/6488.htm
$SQL="delete from `jb51` 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)";
https://www.jb51.net/article/6488.htm
上一篇:如何使用Casbin作为ThinkPHP的权限控制中间件
栏 目:PHP代码
本文标题:PHP 批量删除 sql语句
本文地址:http://www.codeinn.net/misctech/180730.html