-1

When using:

INSERT ... ON DUPLICATE KEY UPDATE 

Is there a callback to tell me how many rows and what changes were made?

I've searched everywhere but can't find any information on this at all.

StudioTime
  • 22,603
  • 38
  • 120
  • 207

1 Answers1

2

In MySQL documentation saids:

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.

Community
  • 1
  • 1
echo_Me
  • 37,078
  • 5
  • 58
  • 78
  • Ok, I saw that, but what does that actually mean? Can you give an example of how to get the data back? In my case there will never be an insert, only an update if different information. – StudioTime Mar 17 '14 at 13:27
  • INSERT just returns true or false. – echo_Me Mar 17 '14 at 13:32
  • 1
    check this http://stackoverflow.com/questions/10925632/getting-number-of-rows-inserted-for-on-duplicate-key-update-multiple-insert it my help you – echo_Me Mar 17 '14 at 13:37