PHP MySQL Data bulk Delete implementation Code _php tutorial

Source: Internet
Author: User
Tags mysql tutorial php mysql
We generally get the data submitted by the form, if we use checkbox[] to operate, see the example below.
-


if ($_post)
{
Print_r ($_post);
The loss is also stored in the form of data,
/*
Array
(
[checkbox] = = Array
(
[0] = 1
[1] = 2
[2] = 3
)

[Button] = Submit
)

This is good operation, we just need to follow
*/
$array = $_post[' checkbox '];
Print_r ($array);
/*
Get the content as follows

Array
(
[0] = 1
[1] = 2
[2] = 3
)

In fact, it is what we want, we can use the SQL in to bulk implementation of the deletion.
*/
$ids = Implode (', ', $array);
$sql = "Delete from table name where ID in ($ids)";
MySQL tutorial _query ($sql);

This enables the implementation of the bulk deletion of the data Oh.
This site original reprint annotated source http://www.bKjia.c0m otherwise must investigate!
}

http://www.bkjia.com/PHPjc/630761.html www.bkjia.com true http://www.bkjia.com/PHPjc/630761.html techarticle we generally get the data submitted by the form, if we use checkbox[] to operate, see the example below. --form Id=form1 name=form1 method=post action= 1 input type=checkbox ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.