html form with drop down box

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hren
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 12:25 am

html form with drop down box

Post by hren »

hi,i have a problem ,i need to make a form that one field need to be a drop down box with entries from my SQL database/table/column.
Thanks in advanced.
daebat
Forum Commoner
Posts: 47
Joined: Mon May 11, 2009 10:16 am

Re: html form with drop down box

Post by daebat »

This is how I do it:

Call to your database and pull the table.

Code: Select all

while($info = mysql_fetch_array( $data ))

Code: Select all

 
 
<select name='year'>
            <option value='".$info['year'] ."'>".$info['year'] ."</option>
 </select>
Post Reply