Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

how to create a drop down list in while loop

Codes here !

Moderators: macek, egami, gesf

how to create a drop down list in while loop

Postby vinayakthbs » Tue Jul 09, 2013 3:21 am

Hi Guys,

As i am novice php developer please help me out to solve the below problem.

1 ) i am fetching the details from the table ( in Mysql ) and displaying to the page

the problem is in one of the column i need to create the drop down list so that user selects from the available options so please help to create a drop down list to achieve the same and any other ways are much appreciated :offtopic:
vinayakthbs
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Jul 09, 2013 3:16 am

Re: how to create a drop down list in while loop

Postby johnj » Tue Jul 09, 2013 7:40 pm

Get the result rows from the table and use <select name="something"><option></option></select>.
if you have more than one item in the drop down, you need to loop and create that many options.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.