INSERT table1 (col1) VALUES (33) ON DUPLICATE KEY UPDATE c=c+1
Is there a simple way to know if INSERT or UPDATE has been performed?
mysql_insert_id() displays the primary (autoincrement) value in both cases no matter if it is a new one or the old one.
I can SELECT c FROM table1 WHERE id=mysql_insert_id()
and see if c==0 (number of times col1 has been tried to be inserted
I am asking to get this result from the first mysql query
Thank you.