Re: Delete using check box
| From: | David Newcomb | Date: | Thu, 07 Sep 2000 10:34:25 +0000 |
| Subject: | Re: Delete using check box | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2684@lists.php.net to get a copy of this message | ||
In the form:
<form ... >
<input type=checkbox name="username[]" value=user1>Delete user1<br>
<input type=checkbox name="username[]" value=user2>Delete user2<br>
<input type=checkbox name="username[]" value=user3>Delete user3<br>
<input type=checkbox name="username[]" value=user4>Delete user4<br>
</form>
When form is submitted:
for ($i=0;$username[$i]!="";$i++)
{
run_sql ("delete from username_table where user=" . $username[$i] );
}
redraw_screen()
Hope this helps;
David.
----- Original Message -----
From: Sharif Islam <mislam@students.uiuc.edu>
To: <php-db@lists.php.net>
Sent: Thursday, September 07, 2000 12:20 AM
Subject: [PHP-DB] Delete using check box
>
> I want to have a user list(from database) and checkbox by their name.
> and i would like to delete the username(from the database) if it was
> checked.
> and also after it was deleted the page will be refreshed and display the
> current users.
> what is the easiest way to do it? I know how to display the list, just not
> sure about how to deal with the check box thing.
>
> Any help will be appreciated.
> thanks
>
>
> ~
> 'v'
> // \
> /( )\
> ^`~'^
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>