PHP 批量删除 sql语句

前端之家收集整理的这篇文章主要介绍了PHP 批量删除 sql语句前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

首先要了解sql语句


$sql="delete from `jb51` where id in (1,2,4)";
表单大概是:
代码如下:
Box" id="ID_Dele[]" value="1"/>
Box" id="ID_Dele[]" value="2"/>
Box" id="ID_Dele[]" value="3"/>
Box" id="ID_Dele[]" value="4"/>


PHP函数主要用到implode
代码如下:
$ID_Dele= implode(",",$_POST['ID_Dele']);
$sql="delete from `user` where id in ($ID_Dele)";

原文链接:https://www.f2er.com/php/29197.html

猜你在找的PHP相关文章