tudor has asked for the wisdom of the Perl Monks concerning the following question:
use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; use strict; my $db_name="scent"; my $o = new CGI; my $tip2 =$o -> param("tip2"); my $DSN="dbi:mysql:$db_name"; my $user="root"; my $pass=""; $dbh = DBI -> connect($DSN,$user,$pass); #return; my $SQL= "select * from par;"; eval { $sth = $dbh -> prepare($SQL); }; if ($@) { $dbh -> disconnect; print $@ } else { $sth -> execute; } ........................................
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Global symbol "$dbh" requires explicit package name
by castaway (Parson) on Oct 23, 2004 at 12:26 UTC | |
by ikegami (Patriarch) on Oct 23, 2004 at 12:33 UTC | |
|
Re: Global symbol "$dbh" requires explicit package name
by techy (Scribe) on Oct 23, 2004 at 12:34 UTC | |
|
Re: Global symbol "$dbh" requires explicit package name
by tachyon (Chancellor) on Oct 23, 2004 at 12:32 UTC |