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; } }

In reply to Re^15: DBI Problem by tultalk
in thread DBI Problem by tultalk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.