"Vincent Jordan" <[EMAIL PROTECTED]> wrote in message
> I have a table that display's a list of users in a mysql db. In the table
> have a echo "<input type="checkbox" name"{$row[$user_id]}">
> {$row[$username]}, {$row[$password}, {$row[$isactive]};
> ( this is not the exact code but its pretty close. )
> What I would like to accomplish is after query and print rows. Each row
> a check box and if the box is checked and delete button is clicked it is
> passed to userdel.php which would take the user_id and delete row.
> Any help would be greatly appreciated.

Write your checkbox the following way:
echo "<input type=\"checkbox\" name\"users[{$row[$user_id]}]\">";

After submitting $_POST['users'] will be an array containing all selected
user ids. You can then just loop through and do your delete queries:

foreach ($_POST['users'] as $user_id => $value) {
    $query = 'DELETE FROM table where user_id = ' . $user_id;
    // commit query

Hope this helps,

Torsten Roehr

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to