Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here's the code. I don't get any data returned.
#!/usr/bin/perl -w # perl modules use CGI; use DBI; use strict; use diagnostics; # setup CGI handle my $cgi = new CGI; # start HTML print $cgi->header; my $dsn = 'DBI:mysql:mydb:localhost'; my $db_user_name = 'mydbusername'; my $db_password = 'mydbpassword'; my $dbh = DBI->connect($dsn, $db_user_name, $db_password); my $sth = $dbh->prepare(qq{select user, topic, topictest from pagedata +}); $sth->execute(); while (my ($username, $topic, $topictext) = $sth->fetchrow_array()) { print "$username, $topic, $topictext"; } $sth->finish(); $dbh->disconnect();
edited: Thu Oct 24 14:54:48 2002 by jeffa - added code tags and s/<br>//g
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI Problem
by Zaxo (Archbishop) on Oct 23, 2002 at 00:15 UTC | |
by thor (Priest) on Oct 23, 2002 at 12:24 UTC | |
|
Re: (nrd) DBI Problem
by newrisedesigns (Curate) on Oct 23, 2002 at 00:15 UTC | |
|
Re: DBI Problem - NEVER MIND
by Anonymous Monk on Oct 23, 2002 at 00:08 UTC | |
by grantm (Parson) on Oct 23, 2002 at 00:14 UTC |