Strange.. the following is returning an empty set:
## connect to the database
my $dbh = DBI->connecT( "dbi:mysql:maindata", "", "" );
## prepare a SQL statement for execution
$sth = $dbh->prepare("SELECT firstname,lastname FROM main");
$sth->execute;
print qq {
<select name="nameselect">
while ($row = $sth->fetchrow_hashref) {
<option>$row->{firstname}</option>
<option>$row->{lastname}</option>
}
</select>
}
## connect to the database
my $dbh = DBI->connecT( "dbi:mysql:maindata", "", "" );
## prepare a SQL statement for execution
$sth = $dbh->prepare("SELECT firstname,lastname FROM main");
$sth->execute;
print qq {
<select name="nameselect">
while ($row = $sth->fetchrow_hashref) {
<option>$row->{firstname}</option>
<option>$row->{lastname}</option>
}
</select>
}