Issues related to deleting multiple records

Source: Internet
Author: User
Issues with deleting multiple records
Issues with deleting multiple records

User Management page, delete a single record I have mastered it now, but how can I delete more than one record at a time?

I know how to use loops, but how do I get the ID of the selected records?

Which Big Brother help me write down the complete code ...

My Code:

PHP Code
  
   


------Solution--------------------
The usual deletion is to put all the IDs in an array such as s[], which is where multiple id,checkbox,value are
The ID of each record,
Common one name s[], if you choose which submission form is an array ah, then $expr = Join (",", $_post[' s ']);
This executes when delete from table where ID in ($expr)
You can do it.
------Solution--------------------
After submission:

PHP Code
$wyx _id=$_post[' wyx_id '];foreach ($wyx _id as $value) {$sql = "delete from table where id= $value";} That's OK.
------Solution--------------------

Post used to be
$ids [0]=id1;
$ids [1]=id2; This form, the upstairs has been said to be very clear.
------Solution--------------------
Many of the main use of conditional statements to control.

For example, ID in ..., or ID > ... or ID not in ...

Wait a minute.
  • 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.