RE: Possible Problem with bind_param



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: Odd DBM::Deep behavior "cannot store tied value" using literal key name
    ... don't know for sure, but since moving to a local drive my code works, ... It happens when you try to assign an array or hash to the database ... that already has a reference to the DBM::Database as an element. ...
    (perl.beginners)
  • Re: ODB (Cache?) vs ORM
    ... This is common and accepted database knowledge. ... > other way is error-prone, thus virtually guaranteed to break integrity, producing ... > is multiple orders of magnitude more powerful than procedural optimization. ...
    (comp.lang.java.databases)
  • Re: Bread and cheese
    ... >> Branston pickle isn't my favourite either. ... > Why do you think that I like _fat_ meat? ... > David, you are thoroughly mistaken about the 'nostalgic items' of my ...
    (soc.history.medieval)
  • Re: Evaluating D2005, help needed.
    ... > quality of Delphi still hasn't crossed below the productivity of Visual ... and had built several database test cases to backup your claims but now it seems ... Delphi for Win32 and VS.NET for .NET and while I'm quite confident that my ...
    (borland.public.delphi.non-technical)
  • Re: OOP database tables <-> php interface (semi LONG)
    ... The Access database has over 30 ... database and business object layers. ... Good point about the flexibility too! ...
    (comp.lang.php)