Re: insert loop logic
| From: | Daniel J. Rychlik | Date: | Wed, 04 Jun 2003 21:28:57 +0000 |
| Subject: | Re: insert loop logic | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150272@lists.php.net to get a copy of this message | ||
perhaps, a foreach loop and use the empty () function. Thats how I did it.
----- Original Message -----
From: "Ryan A" <ryan@jumac.com>
To: <php-general@lists.php.net>
Sent: Tuesday, June 03, 2003 5:24 PM
Subject: [PHP] insert loop logic
> Hi,
> Can you tell me whats the best way of doing this please?
>
> I am getting values from a form's checkboxes
> (eg
> <input type=checkbox name='id[]' value=1>
> <input type=checkbox name='id[]' value=2>
> etc)
>
> When i get these values I want to enter them into the database but
> 1)I should enter only the first 5 (and ignore the rest) into the database
> 2)it has to enter 1 record for every every "id" picked
> eg:
> if id[1], id[2],id[3] and id[4] were picked it should enter this as 4
> differient records
>
>
> How do i do this? I have tried using a for loop but somewhere the logic is
> very very bad :-) and so i deleted the whole damn thing.
>
> What do you think?
> When replying if possible reply with a little code as am feeling
braindead.
>
> Cheers,
> -Ryan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>