in reply to How to use checkbox to delete mutiple rows from database


Hi,
you can get the list of users from the DB. Display the users and make sure that your checkbox value should identify the user_id ( may be whatever u can identify your user as unique ).When multiple users are selected,then in the CGI you can get it (user ids )in the array-context .If your db supports sub-query then, you just do,
delete from tbl_name where id in (join(',',@usr_id_array));
Oterwise, you just prepare a delete query (outside the loop )and execute the query in the for loop for each user id.
This will delete all the users from the db.
-kulls.

Replies are listed 'Best First'.
Re: How to use checkbox to delete mutiple rows from database
by b10m (Vicar) on Nov 14, 2005 at 11:10 UTC

    And at least, using this technique, you open up your script to a lot of possible abuse. It's not too hard to post some additional SQL commands to your database this way.

    --
    b10m

    All code is usually tested, but rarely trusted.