Forum Moderators: coopster
I just can't seem to figure out how to load the data into the combo box. Any help would be appriciated.
A while loop should do the trick. Do you have a unique id number for each field? If so, something like this:
$query = mysql_query("SELECT data FROM table") or die(mysql_error());echo "<select name=\"select\">\n";
while ($row = mysql_fetch_assoc($query))
{
echo "<option value=\"".$row['id']."\">$row['fieldname']</option>\n";
}echo "</select>\n";
Then when you process your form:
$select = $_POST['select'];
$query2 = mysql_query("SELECT FROM table WHERE id = '$select' LIMIT 1") or die(mysql_error());
//display data
Hope that helps.
dc