开发者

drop down box php

开发者 https://www.devze.com 2022-12-25 15:48 出处:网络
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 a

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号