Hi,
Can someone help me modify this code?
I am using the following code to populate a drop down menu with mysql output to allow the user to select a name in a form.
PHP Code:
// SQL QUERY while($queryIds->fetchInto($queryId)) { $id=$queryId["personId"]; $forename=$queryId["first_name"]." ".$queryId['surname']; $options.="<OPTION VALUE=\"$id\">".$forename."</OPTION>"; } // Ene of while echo " <SELECT NAME='person'> <OPTION VALUE=.$id.>Person ".$options." </SELECT>";
How can I make the names in the drop down menu have a field name / value that can be used when the form is submitted?
For example, with a drop down menu that doesn't have mysql each option has a value which can then be used. In the drop down menu I'm using it displays names of people and I want the value of the option for each person to be the personId stored in the database for that person.
Any suggestions?
Last edited by drew22299 : 06-27-2008 at 11:54 AM.
|