vbrtrmn has asked for the wisdom of the Perl Monks concerning the following question:
Hey, I'm having some probs w/ DBI today. My code bombs with:
Can't call method "do" on an undefined value at /var/www/html/sites/www.auroraborealis.org/cgi-bin/gbdbconnect.cgi line 19.
Here's my code:
#!/usr/bin/perl -w use strict; use DBI; use CGI::Carp "fatalsToBrowser"; use CGI ":all"; my $username = 'USERNAME'; my $pass = 'PASSWORD'; my $db = 'DBI:mysql:auroraborealis:localhost'; my $db_object = DBI->connect($db, $username, $pass); print header(); print "<PRE>"; my $sql = "SELECT * FROM guestbook ORDER BY name"; my $dbh->do($sql); $dbh->disconnect(); exit;
--
paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't call method "do" - DBI Troubles
by broquaint (Abbot) on Feb 03, 2003 at 14:05 UTC | |
|
Re: Can't call method "do" - DBI Troubles
by robartes (Priest) on Feb 03, 2003 at 14:17 UTC | |
|
Re: Can't call method "do" - DBI Troubles
by Cabrion (Friar) on Feb 03, 2003 at 14:28 UTC | |
by Hero Zzyzzx (Curate) on Feb 03, 2003 at 17:58 UTC | |
|
Re: Can't call method "do" - DBI Troubles
by electrosphere (Beadle) on Feb 03, 2003 at 17:14 UTC |