This is a function I made which covers my needs. May be of some help for
you. This is a "select" box but I'm sure you can modify it for a combo box.
$form_fiel_name is the name you want the box to have in your web form.
$table is the table from you want to retrieve the information
$field is the specific field from the table
$kind could be simple or multiple
function show_list_field($form_field_name, $table, $field, $kind)
{
$list_result = "";
$list_result .= "<select name=\"".$form_field_name."[]\" size=\"5
\" ".$kind.">";
$query = "select $field from $table";
$result = mysql_query($query) or die($mysql_error());
while($row = mysql_fetch_array($result))
{
$list_result .= "<option value=\"$row[$field]
\">".htmlspecialchars(stripslashes($row["$field"]))."</option>";
}
$list_result .= "</select>";
return $list_result;
}
Hope it helps
*******************************************************
Wilmar P�rez
Network Administrator
Library System
Tel: ++57(4)2105145
University of Antioquia
Medell�n - Colombia
2002
*******************************************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php