We generally obtain the data submitted by the form. If we use checkbox [] to perform this operation, we will look at the instance below.
-->
<Form id = "form1" name = "form1" method = "post" action = "">
1
<Input type = "checkbox" name = "checkbox []" id = "checkbox" value = "1"/>
2
<Input type = "checkbox" name = "checkbox []" id = "checkbox2" value = "2"/>
3
<Input type = "checkbox" name = "checkbox []" id = "checkbox3" value = "3"/>
<Input type = "submit" name = "button" id = "button" value = "submit"/>
</Form>
<?
If ($ _ post)
{
Print_r ($ _ post );
// The input is also saved as data,
/*
Array
(
[Checkbox] => array
(
[0] => 1
[1] => 2
[2] => 3
)
[Button] => submit
)
In this way, we only need
*/
$ Array = $ _ post ['checkbox'];
Print_r ($ array );
/*
The result is as follows:
Array
(
[0] => 1
[1] => 2
[2] => 3
)
In fact, 1, 2, and 3 are what we want. We can use SQL in to batch delete them.
*/
$ Ids = implode (',', $ array );
$ SQL = "delete from table name where id in ($ ids )";
Mysql tutorial _ query ($ SQL );
// Batch Delete the data.
// This site original reprint indicated source http://www.bKjia. c0m otherwise will be investigated!
}