in reply to MySQL and Perl... Update record Prob

In addition to fokat's remarks on not disconnecting, I see some other problems.

Update: Ok, time for some debug-fu. If you are not already doing so, open the DBI connection with the {RaiseError=>1} attribute. That will cause your program to die with an error message whenever MySQL access causes an error. Scatter some print statements inside your conditionals to mark what code is reached.

After Compline,
Zaxo

  • Comment on Re: MySQL and Perl... Update record Prob

Replies are listed 'Best First'.
Re: Re: MySQL and Perl... Update record Prob
by powerhouse (Friar) on Feb 03, 2003 at 06:32 UTC
    Ok. I've changed the undefs to '' and then to {}.
    It now looks like this:

    if (defined($in{new_aff}) && $in{new_aff} == 1) { if ($in{tax_id} ne "") { $dbh->do (qq{ UPDATE reg_users SET tax_id = ? WHERE us +ername = ? }, {}, $in{tax_id}, $username); } $dbh->do (qq{ UPDATE reg_users SET aff_url = ? WHERE usern +ame = ? }, {}, $in{aff_url}, $username); $dbh->do (qq{ UPDATE reg_users SET aff = ?, aff_su_date = +? WHERE username = ? }, {}, "yes", $formated_date, $username); } $dbh->do (qq{ UPDATE reg_users SET html_email = ? WHERE userna +me = ? }, {}, $in{html_email}, $username); $dbh->disconnect();

    Same Effect. It updates ONLY the columns: "aff" and "aff_su_date"!

    Any other ideas?

    Thx,
    Richard.