Gossamer Forum
Home : Products : DBMan : Customization :

build select field

Quote Reply
build select field
With this code i can build a select list from a other DB. But this list has a lot of double entrys. Is it possible to filter this list so that i have only one entry with the same name ?

Code:
<SELECT NAME="Ortopen (DB, "<$db_file_name2") or &cgierr("unable to open $db_file_name2. Reason: $!");
if ($db_use_flock) { flock(DB, 1); } LINE: while (<DB> ) { next if /^#/; next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
if (!(grep $_ eq $fields[3], @selectfields)) { push (@Ort, $fields[3]); } } close DB;
foreach $category (@Ort) { print "<OPTION>$category";
} print qq|</SELECT>