SoFunction
Updated on 2025-03-09

PHP batch delete sql statements

First of all, you need to understand SQL statements
$SQL="delete from `jb51` where id in (1,2,4)";
The form is probably:
Copy the codeThe code is as follows:

<form action="" method="post">
<input name="ID_Dele[]" type="checkbox" value="1"/>
<input name="ID_Dele[]" type="checkbox" value="2"/>
<input name="ID_Dele[]" type="checkbox" value="3"/>
<input name="ID_Dele[]" type="checkbox" value="4"/>
<input type="submit"/>
</form>

PHP function mainly uses implode
Copy the codeThe code is as follows:

$ID_Dele= implode(",",$_POST['ID_Dele']);
$SQL="delete from `user` where id in ($ID_Dele)";

https:///article/