Page 1 of 1

html form with drop down box

Posted: Thu Mar 25, 2010 8:10 am
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.

Re: html form with drop down box

Posted: Thu Mar 25, 2010 9:16 am
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>