Is there an efficient way to get the list of affected row IDs (not the # of affected rows via PHP\'s mysql_affected_rows(), but the actual row ids that were affected) from a
try this, it will return the updated ids as "1,2,3....":
SET @uids := ''; UPDATE table_name SET some_col= 'some_val' WHERE some_col= 'some_val' AND ( SELECT @uids := CONCAT_WS(',', @uids, id) ); SELECT TRIM(LEADING ',' FROM @uids);