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.

Leave a Reply