Hi Philip,

Yes, $dbh->{RaiseError} is set to 1. I have the code surrounded in an eval that does a rollback if there is an error, or a commit if there is no error. The code is committing and the query is being executed, just not with the value I expect.

Thanks,
Dave

On Nov 10, 2006, at 4:21 PM, Garrett, Philip ((MAN-Corporate)) wrote:

David Wu wrote:
[snip]

I have some code that automatically tries to update a user's email
address if it has changed when they come through using an
integration.  However, it seems that although there was no error with
the database, the update does not go through.  Here is the code for
reference:

             my $sql = "UPDATE m_user SET email = ?, first_name = ?,
last_name = ? WHERE id = ?;";
             my $sth = $dbh->prepare($sql);
             $sth->bind_param(1, $get_vars->{new_email});
             $sth->bind_param(2, $get_vars->{userfirstname});
             $sth->bind_param(3, $get_vars->{userlastname});
             $sth->bind_param(4, $api_user_id);
             $sth->execute;
             $sth->finish;

I see you aren't checking for errors. Is $dbh->{RaiseError} turned on?

Regards,
Philip

Reply via email to