in reply to Re: Drop Down Selection From Database
in thread Drop Down Selection From Database
use CGI;
use DBI;
use strict;
my $q = new CGI;
print $q->header();
print "<html><form><select>\n";
my $dbh = DBI->connect(&DSN, &USER, &PASS);
my $sth = $dbh->prepare("SELECT memberID, membername FROM members");
$sth->execute();
while( my ($memberID, $membername) = $sth->fetchrow_array() ) {
print "<option value="$memberID">$membername \n";
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Drop Down Selection From Database
by Anonymous Monk on Jan 26, 2001 at 20:40 UTC |