SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    South-West UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple delete scripts.?

    Hi all,

    Can anyone point me in the direction of some good scripts that use check box's to perform multiple deletes of data stored in a mysql database.

    I can't seem to find any tutorials that cover this kinda thing on the net.

    Any help will be greatly appreciated.

    Thanks
    Matt

  2. #2
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Form:
    <input type="checkbox" name="ids[]" value="1">
    <input type="checkbox" name="ids[]" value="2">
    <input type="checkbox" name="ids[]" value="3">
    .
    .
    .
    php:
    $hereValuesCommaSeperated = implode(",", $_POST["ids"]);

    mysql query in php:
    $queryStr = "Delete From tableName where tbl_id in ($hereValuesCommaSeperated)";


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •