寻求一种有效的方法来查找受mysql UPDATE操作影响的行

I am using php.

$sql = "UPDATE `table` SET `field` = 'value' WHERE `item_id` IN (comma separated list of item_ids)";

If I execute the above query, how can I find out which item_id's where updated? Note that some of the id's in the comma separated list of item_ids do not exist in the 'table' otherwise the answer would be trivially every id in the comma separated list.

I am using the mysql api where you connect via mysql_connect().

use mysql_affected_rows(). it will return the table's incremented id's array which are affected in the last query.