Home : General : Databases and SQL :

General: Databases and SQL: Re: [termid0g] quick DBI question: Edit Log

Here is the list of edits for this post
Re: [termid0g] quick DBI question
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:

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();

Last edited by:

Paul: May 28, 2002, 8:59 AM

Edit Log: