Re: [PHP-DB] database/form help needed
Use Then you'll have an array of the boxes checked with the id as the array key. olinux --- Neil Thomson <[EMAIL PROTECTED]> wrote: > try using the rand function.. > eg... > $rand=rand(1,10); > > > > but that migth get a same number more then once... > my suggestion is this > > $checkboxid="1"; > // Start of the loop > echo ""; > // end of loop > $checkboxid = $checkboxid + 1; > > that should work i think > > havent tested that code. but thats my idea. > > Neil > __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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]
Re: [PHP-DB] database/form help needed
You could setup an autoincremented unique integer field in your db table(s), then when you fetch the row from the table use the id in generating your checkbox name. -ib 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 > -- "Out beyond the ideas of wrong-doing and right-doing there is a field. I'll meet you there." -Rumi *(O)* [EMAIL PROTECTED] *** under construction *** http://centralcoasthealing.net Healing Resources on the Central Coast http://kornsnake.com Internet Development -- 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]
Re: [PHP-DB] database/form help needed
try using the rand function.. eg... $rand=rand(1,10); but that migth get a same number more then once... my suggestion is this $checkboxid="1"; // Start of the loop echo ""; // end of loop $checkboxid = $checkboxid + 1; that should work i think havent tested that code. but thats my idea. Neil - Original Message - From: Chris Payne <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 05, 2002 10:59 PM Subject: [PHP-DB] database/form help needed 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]
[PHP-DB] database/form help needed
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