Re: Multiple select box using mysql
| From: | Corne' Cornelius | Date: | Tue, 18 Feb 2003 11:01:31 +0000 |
| Subject: | Re: Multiple select box using mysql | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25724@lists.php.net to get a copy of this message | ||
You have to give the Mutli select box a name as an array. eg:
<SELECT NAME="experts[]" MULTIPLE SIZE=5>
<OPTION VALUE="key1">val1</OPTION>
</SELECT>
then in PHP, you can access $experts as an array.
while (list ($key, $val) = each($experts)) {
print "$key = $val<BR>\n";
}
Jason End wrote:
I writing a software catalog that features "experts", who a people especially skilled in a piece of software. My db, has a "software" table and an "experts" table. I need to have a page that generates 2 multiple select boxes, each on with the data from each table.=============Disclaimer and Confidentiality=================== This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon he information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ======================================================From there one will be able to choose the softwareprogram and the experts, which will then record the software-expert relationship in the DB. The problem is that I don't really understand how to populate multi select boxes with db data, and then have the selections passed back as inserts. Can someone clue me in? thanks, Jay __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com