I\'m doing an INSERT ... ON DUPLICATE KEY UPDATE
for a PRIMARY KEY
in the following table:
DESCRIBE users_interests;
From the manual:
With ON DUPLICATE KEY UPDATE, the affected-rows value per row is 1 if the row is inserted as a new row and 2 if an existing row is updated.
So you know whether you updated a row (duplicate key) or just inserted one: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html