Turn your checkboxes into an array
<input type ="checkbox" name="id[]" val="<?php echo $thisid ?>">

And then parse the array when you POST the form

while (list($key,$val)=each($id)) {
    echo "$val"; // this is an id that was checked
} // end while

The virtue of this is you don't have to check for all possible values (id1, id2, id3, 
etc), you'll only end up working with checkboxes that have been checked.

kind regards,


Chris Payne wrote:

> Hi there everyone,
> I have a loop which goes through my MySQL database and some PHP code which grabs 
>results 9 at a time, and that works great.  Now, I also have a checkbox called ID for 
>each of the 9 entries and here is my problem.
> How can I dynamically assign a unique ID for my checkboxes?  I am getting my 
>checkboxes through a loop, and because of that the ID is called id - for all of my 
>entries, so I can't select multiple as only one entry comes out on the results page.  
>How can I dynamically create checkboxes with a unique id (Such as id1, id2 etc ...) 
>so that I can make multiple selections from my DB?
> Thank you all so much - Happy New Year.
> Regards
> Chris Payne
> www.planetoxygene.com

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to