Re: Possible Problem with bind_param



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

.



Relevant Pages

  • Re: transaction demarction
    ... do they mark something? ... a banking transaction that moves money from one bank account ... that involves database access and ends when you either COMMIT or ROLLBACK. ...
    (comp.lang.java.programmer)
  • Re: transaction demarction
    ... a banking transaction that moves money from one bank account ... a "demarcation" between the two units of work. ... that involves database access and ends when you either COMMIT or ROLLBACK. ...
    (comp.lang.java.programmer)
  • Re: transaction demarction
    ... do they mark something? ... a "demarcation" between the two units of work. ... the COMMIT or ROLLBACK statement marks the end of the unit of work so ...
    (comp.lang.java.programmer)
  • Hein is in the house :-) (was Re: Recommended HP COBOL way to exit a paragraph or perform early?
    ... commit or rollback. ... Committed but RMS just keeps getting better and better so is Repeatable Read ... node) the RMS Exec Mode Rundown handler will Rollback any outstanding ... transactions that a process may have if/when that particular process gets ...
    (comp.os.vms)
  • Re: newbie prolog question, passing functions
    ... Rollback can ... This is a simulation of a database age, implemented as two ... add, get, commit, rollback and ... exit. ...
    (comp.lang.prolog)