Re: Delete Multiple Records From Checkboxes
| From: | Curt Zirzow | Date: | Thu, 27 May 2004 05:16:40 +0000 |
| Subject: | Re: Delete Multiple Records From Checkboxes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187034@lists.php.net to get a copy of this message | ||
* Thus wrote Albert Padley (apadley@apadley.com):
>
> <input type=\"checkbox\" name=\"del[]\" value=\"" .
> $row['id'] . "\">
>
> The processing code is:
>
> if (count($del) > 0){
> for ($i=0;$i<count($del);$i++){
>
> $query = "DELETE FROM ref_events_reg WHERE id = '$del[$i]'";
> }
> }
I think you need to take a step back and figure out where the $del
variable is comming from.
Both solutions that have been provided should have worked if $del
was really an array.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."