Getting data from table into html form

I want to compare two sets of data from a table through a website, and I want to be able to select which sets of data to compare with html form. I need to know how to get all entries in the “name” column of the table into a drop down list in the form without having to go back and reprogram the page every time a new entry is added.

I’m a complete beginner with programming, so any help is greatly appreciated. Thanks!

here you go, something like this will do:
[php]<?php
// make a query and run it (fetch names and order them alphabetically if not required just delete the ORDER BY name ASC part of the query)
$query = “SELECT name FROM database ORDER BY name ASC”;
$result = mysql_query($query);

// run a while loop to display the names in a drop box
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo ‘’ . $row[‘name’] . ‘’;
}
?>[/php]

Hope that helps,

Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service