We have a database that gets updated everyday at midnight with a cronjob, we get new data from an external XML.
What we do is that we insert all the new content and
You can get this information at the time of the insert/update by examining the number of affected rows in the result set.
MySQL documentation states:
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.
You'll need to combine ROW_COUNT with LAST_INSERT_ID to get your answer and insert one row at a time.