perleager has asked for the wisdom of the Perl Monks concerning the following question:
&account_verify; use DBI; my $dbh = DBI->connect('DBI:mysql:MAIL') or die "Couldn't connect to +database: " . DBI->errstr; $sql = "SELECT DISTINCT date FROM mailserve"; $sth = $dbh->prepare($sql) or print "preparing: ",$dbh->errstr; $sth->execute or print "executing: ", $dbh->errstr; $row = $sth->fetchrow_hashref; $dbh->disconnect; ######################## &header; print <<EOF; <B><u>To Do Date Reports</u>:</B><BR><BR> EOF print <<EOF; <a href="/mailtodo.pl?username=$username&session=$session&action=viewd +ate&date=$row->{'date'}">$row->{'date'}</a> EOF while (@rowxx = $sth->fetchrow_array()) # keep fetching until # there's nothing left { print <<EOF; <a href="//mailtodo.pl?username=$username&session=$session&action=view +date&date=$rowxx[1]">$rowxx[1]</a> EOF } print <<EOF; </table> <br> EOF $sth->finish; &footer;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI fetch array
by FamousLongAgo (Friar) on Oct 21, 2002 at 02:54 UTC | |
|
Re: DBI fetch array
by grep (Monsignor) on Oct 21, 2002 at 02:48 UTC | |
|
Re: DBI fetch array
by busunsl (Vicar) on Oct 21, 2002 at 08:42 UTC |