Phpmysql data batch deletion implementation code. We generally obtain the data submitted by the form. if we use checkbox [] to perform this operation, we will look at the instance below. -- Formidform1nameform1methodpostaction1inputtypecheckbox we generally obtain the data submitted by the form. if we use checkbox [] to operate it, let's look at the instance below.
-->
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!
}
Bytes. -- Form id = form1 name = form1 method = post action = 1 input type = checkbox...