How would i populate a drop box with the content of a mysql databse ?
A Anonymous Guest Feb 17, 2003 #1 How would i populate a drop box with the content of a mysql databse ?
A Anonymous Guest Feb 17, 2003 #2 Code: <?php $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>'; ?>
Code: <?php $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>'; ?>