Zend_Db_Adapter::update() returns number of rows in which values have been changed

December 5, 2008

… and not the number of rows that match the conditions.

Just so you know. Caught me out for a while there – I was using the return value from update() to check that certain values (including a timestamp) were set correctly while at the same time updating the timestamp, but if the method got called twice in a second I’d get zero as a return value the 2nd time because the timestamp was the same and so no values were being changed.

Advertisements

One Response to “Zend_Db_Adapter::update() returns number of rows in which values have been changed”

  1. Arnold Says:

    Thanks a lot for this, I was confused.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: