$db->update() returns the affected amount of rows.
There is no Zend_DB method for insert ... on duplicate key update ..., so one should use the query() method:
$result = $db->query('INSERT INTO table(key, field) SELECT val1, val2 FROM table as t2 ON DUPLICATE KEY UPDATE field = VALUES(field)');
To find out the am开发者_StackOverflow中文版ount of affected or inserted records: $result->rowCount()
But this method also counts all the records that were updated with the same value.
I need to know all of the actual affected (changed) records.
Thanks!
Unfortunately the "On Duplicate Key Update" causes ROW_COUNT() or mysql_rows_affected() to report rows with multiple updates, it is not a count of UNIQUE rows that are updated.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论