Thanks for the links. You knew what to search for. I search for the "i can't work out... and did not find what you found.
Sounds just like my problem.
I inserted code before each of the two ExecuteQuery calls:warn("1st call Connection-database handle: '$dbh' dsn: '$dsn'");
and
warn("2nd call Connection-database handle: '$dbh' dsn: '$dsn'");
And got the following in the error log:
Fri Sep 29 17:28:23 2017 manage_users.cgi: 1st call Connection-database handle: 'DBI::db=HASH(0x2928270)' dsn: 'dbi:mysql:database=jalamior_assoc_mgr;host=localhost' at /home/jalamior/www/httpsdocs/cgi-bin/lib/perl/manageusers.pm line 625.
Fri Sep 29 17:28:23 2017 manage_users.cgi: 2nd call connection-database handle: 'DBI::db=HASH(0x2928270)' dsn: 'dbi:mysql:database=jalamior_assoc_mgr;host=localhost' at /home/jalamior/www/httpsdocs/cgi-bin/lib/perl/manageusers.pm line 666.
(in cleanup) Can't connect to data source '' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at /usr/local/lib/perl5/site_perl/5.8.8/CGI/Session/Driver/DBI.pm line 26
I don't see where "it can't see the driver information.." So this must mean that something happens downstream in the call to executequery. Now back to square one as best I can see. I added $session->flush() with no effect.
sub ExecuteQuery { my ($SQL) = @_; my $sth = $dbh->prepare($SQL) or die $dbh->errstr; $sth->execute() or die $dbh->errstr; # $dbh->commit or die $dbh->errstr; # my $sth = $dbh->prepare($SQL) || ErrorMessage($SQL); # $sth->execute() || ErrorMessage($SQL); return $sth; $session->flush(); }
Session opened for all routines in this .pm
sub OpenSession{ my ($dbh, $sid)= @_; $session = new CGI::Session("driver:MySQL", $sid, {Handle=>$dbh, Lo +ckHandle=>$dbh}); return $session; }
Can you see a problem with these?
In reply to Re^2: DBI Problem
by Anonymous Monk
in thread DBI Problem
by tultalk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |