drop box

Codes here !

Moderators: macek, egami, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 32
Joined: Tue Jan 28, 2003 10:19 am
Location: Québec

drop box

Post by border20 » Mon Feb 17, 2003 7:46 am

How would i populate a drop box with the content of a mysql databse ?

User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Post by Redcircle » Mon Feb 17, 2003 8:03 am

Code: Select all

$query = 'select id,content from table';
$request = mysql_query($query);
echo '<select name="form_select">';
while($row = mysql_fetch_array($result))
echo '<option value="'.$row['id'].'">'.$row['content'].'</option>';
echo '</select>';

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests