RE: [PHP-WIN] Deleting multiple items from database using checkboxes
| From: | Davy Obdam | Date: | Mon, 07 Oct 2002 21:27:08 +0000 |
| Subject: | RE: [PHP-WIN] Deleting multiple items from database using checkboxes | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16237@lists.php.net to get a copy of this message | ||
Hi Dash,..
Your right i forgot the * in my mysql_query, it should be DELETE * FROM
gastenboek WHERE entryID=$whatever
Best regards,
Davy Obdam,
mailto:info@davyobdam.com
-----Original Message-----
From: Dash McElroy [mailto:dash.php@westonefcu.org]
Sent: Monday, October 07, 2002 11:15 PM
To: 'Davy Obdam'; Php-Windows Mailing
Subject: RE: [PHP-WIN] Deleting multiple items from database using
checkboxes
Wouldn't you want to do a foreach() loop?
i.e.
foreach($dele as $whatever) {
mysql_query(DELETE FROM gastenboek WHERE entryID=$whatever); }
I'm sure the syntax on the mysql_query line isn't right...
The multiple database calls can be expensive if you're deleting lots of
information.
-Dash
-----Original Message-----
From: Davy Obdam [mailto:info@davyobdam.com]
Sent: Monday, October 07, 2002 1:05 PM
To: Php Mailinglist; Php-Windows Mailing
Subject: [PHP-WIN] Deleting multiple items from database using
checkboxes
Hi people,.
I have a guestbook admin page were i would like to delete one item or
more items from the database if necessary. I have modified my normal
guestbookpage so that it has checkboxes in front of every entry. This is
my code:
<input type=\"checkbox\" name=\"dele[]\"
value=\"".$sql['entryID']."\">
Now i can select multiple items. But i have tried to delete em, but it
only deletes one item from the database, my query looks like this :
DELETE FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
for your time.
Best regards,
Davy Obdam,
mailto:info@davyobdam.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
================================================================
Deze e-mail is door E-mail VirusScanner van Planet Internet
gecontroleerd op virussen. Op http://www.planet.nl/evs staat
een
verwijzing naar de actuele lijst waar op wordt gecontroleerd.