Reply to Re: Whats the best way to do this?

Your name:

Reply:


Posted by IchBin on 09/11/06 22:41

Flic wrote:
> frothpoker wrote:
>> PHP is a server side language so you would use it to replace hard coded
>> <OPTION value = Blue>Blue</OPTION>
>> <OPTION value = Green>Green</OPTION>
>> <OPTION value = Black>Black</OPTION>
>>
>> with colours from a database query or some other source.
>
> I know this much, my question was how? If each of the different item
> had different colours how would it be best to populate the list?
> Something like i++ would work on single rows, but what about a single
> entry?
>

If you do not mind you could use the PEAR package HTML_QuickForm. With
this package I can load a dropdown, from a database table, in three
statements. Example:

//
// Add the <Select> load from $DB to form
$s =& $form->createElement('select','u_category','Category:' );
$s->loadQuery($db, $category_dropdown_select);
$form->addElement($s);

There is a excellent tutorial on using the HTML_QuickForm package here:

http://www.devarticles.com/c/a/Web-Graphic-Design/Using-HTML-Quickform-for-Form-Processing

I have not look at HTML_QuickForm2 that is suppose to be a newer
incarnation of HTML_QuickForm.

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация