drop down box php
I have stored 6 records in mysql db,when i use this code each of the 6 records getting displayed in seprate drop down box,i want the开发者_如何学编程m to be displayed in a single drop down box.Where am i going wrong? Any help ii be appreciated. Thnx in advance.
http://dpaste.com/hold/180077/
You want to do something like this:
<select>
while ($row = mysql_fetch_array($result)) {
echo "<option><!-- put option text here --></option>\n";
}
</select>
On line 17, you should have multiple options printed, with one select and one end-select.
You need to put the select outside of the for loop. Just the option tag and it's contents should be written in the loop.
精彩评论