in reply to Re^12: DBI Problem
in thread DBI Problem

Tried $dbh->trace(2);

Sat Sep 30 18:42:26 2017 manage_users.cgi: call after 2nd execute: 'DBI::db=HASH(0x21ec980)' dsn: 'dbi:mysql:database=jalamior_assoc_mgr;host=localhost' at /home/jalamior/www/httpsdocs/cgi-bin/lib/perl/manageusers.pm line 684.

-> DESTROY for DBD::mysql::st (DBI::st=HASH(0x1f09930)~INNER)

<- DESTROY= undef at manage_users.cgi line 245

-> DESTROY for DBD::mysql::st (DBI::st=HASH(0x21ecca0)~INNER)

--> dbd_st_finish

>- dbd_st_free_result_sets

<- dbd_st_free_result_sets RC -1

<- dbd_st_free_result_sets

<-- dbd_st_finish

<- DESTROY= undef at manage_users.cgi line 245

! -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x1f09520)~INNER)

Freeing 1 parameters, bind 0 fbind 0

! <- DESTROY= undef during global destruction

>> DESTROY DBI::db=HASH(0x21ec870) clearing 1 CachedKids

! -> DESTROY for DBD::mysql::db (DBI::db=HASH(0x21ec870)~INNER)

imp_dbh->pmysql: 227bfe0

! <- DESTROY= undef during global destruction

Sat Sep 30 18:42:26 2017 manage_users.cgi: (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

DESTROY= undef at manage_users.cgi line 245

manageusers::OpenConnection(); #This is called for update member info Line 245---> if (!UpdateUserData($sid,$password,$email,$secret)) { ## manageusers::CloseConnection(); CreateUserFeedbackForm("Update of Member informatio +n failed. Please contact the office."); return; } else { # manageusers::CloseConnection(); CreateUserFeedbackForm("Update of Member informatio +n succeeded."); #Need to email back to office. return; } return;

So is the destroy undefined the problem to chase?

Replies are listed 'Best First'.
Re^14: DBI Problem
by huck (Prior) on Oct 01, 2017 at 01:39 UTC

      Fixed. Thanks all.

      sub UpdateUserData { # $dbh->trace(2); my ($sid, $password,$email,$secret) = @_; $session = new CGI::Session("driver:MySQL",$sid, {Handle=>$dbh}); my $SQL = qq|SELECT id FROM $sql_session_table WHERE id = '$sid' | +; my $sth = ExecuteQuery($SQL); my ($tsid, $userid) = $sth->fetchrow_array(); if (!$tsid) { return 0; } else { my $userid = $session->param("user_id"); my $username = $session->param("username"); if (! defined $userid ){ return 0; } my $updateinfoemail = "webpass\@jala-mi.org"; my $passpart = ""; my $mailpart = ""; my $secretpart = ""; if ($password ne "") { $passpart = "password = '$password'"; } if (($email ne "") && ($password eq "")) { $mailpart = "email = '$email'"; } elsif (($email ne "") && ($password ne "")) { $mailpart = ", email = '$email'"; } if (($secret ne "") && ($password eq "") && ($email eq "")) { $secretpart = "secret = '$secret'"; } elsif (($secret ne "") && (($password ne "") || ($email ne "") +)) { $secretpart = ", secret = '$secret'"; } my $wherepart = " where user_id = '$userid'"; my $statement = "update $sql_user_table set $passpart $mailpar +t $secretpart $wherepart"; $SQL = qq| $statement |; my $sth1 = ExecuteQuery($SQL); # success so disconnect and send an e-mail with the missing/al +tered information to the user. $session->flush() or die "Unable to update session storage\n" +; my $password1 = "'06#$password&422'"; my $userid1 = "61345$userid"; my $message = "The member has updated their information throug +h the website. The member userid is :'$userid1'. Their new password i +s '$password1' "; my $subject = 'JALA Update Information Request.'; my $from = 'webmaster@jala-mi.net'; my $to = $updateinfoemail; my $body = $message; my $heading = "Member Update Information"; my $closing = "Office Manager: Please update the member databa +se."; my $signiture = "JALA Support"; my $result = SendMemberMail($subject,$from,$to,$heading,$body, +$closing,$signiture); return 1; } }

      Somehow you still think this has to do with ExecuteQuery but it does not.

      No I don't. I was just looking at the dbh dbi around the calls to execute.