I think that if you start the select then enter into a while loop then close it out that would work...
PHP Code:
function builddropdown($connectionType, $connectionName, $connectionPass, $name, $dbTable, $dbField){
echo"<select name=$name >\n";
$con = mysql_connect($connectionType, $connectionName, $connectionPass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$dbName", $con);
$result = mysql_query("SELECT * FROM $dbTable GROUP BY $dbField HAVING 0 < count( $dbField ) ORDER BY $dbField ASC");
while($row = mysql_fetch_array($result))
{
echo "<option value=".$row['FieldName']." >".$row['FieldName']."</option>\n";
}
echo "</select>\n";
}
just call this function in your form.
Bookmarks