Do you need the select list to build a new option for each first/last name or should it be like:
<option>Fisrt Last</option>
?
This will do the second option:
my $sth = $dbh->prepare("SELECT firstname,lastname FROM main") or die DBI->errstr;
$output .= qq|<option>$row->{firstname} $row->{lastname}\n| while (my $row = $sth->fetchrow_hashref);
$output .= qq|</select>|;
$sth->finish();
<option>Fisrt Last</option>
?
This will do the second option:
Code:
my $output = qq|<select name="nameselect">|; my $sth = $dbh->prepare("SELECT firstname,lastname FROM main") or die DBI->errstr;
$output .= qq|<option>$row->{firstname} $row->{lastname}\n| while (my $row = $sth->fetchrow_hashref);
$output .= qq|</select>|;
$sth->finish();