faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL : Questions in search of an Answer

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 24 people (42%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How can I make multiple selections from a listbox that read values from MySQL

Nov 24th, 2001 15:32
Jake Edstrom, Jonathan Sharp, Peter Lagland, Onno Benschop,


for your select field, set the name to "variable[]" and in PHP 
$variable will be an array of selections, as far as building the list 
from mysql... just loop through a table with your fields, and print an 
option tag.
Additional note:
In order to be able to make multiple simultaneous selections from a 
select tag you must specify the mulitple attribute of the 
select tag.