Home : General : Databases and SQL :

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

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

}

Last edited by:

termid0g: May 28, 2002, 10:30 AM

Edit Log: