At 6:05 PM -0600 2000-02-23, Joey Mukherjee wrote:
>I have a text file which I parse in my program and then do the INSERT into the
>I don't want duplicates in my database of course so my primary key
>from happening. However, I would like to know about the duplicate attempt.
>If I do an INSERT IGNORE, mysql_info never returns anything. Leaving out the
>IGNORE, mysql will abort after the first duplicate. If I do a
>will abort after the first duplicate. A DELAYED will let all the entries be
>inserted, but never return anything just like the INSERT IGNORE.
>Is there a way to find out when I am trying to add a duplicate, without having
>to query the database first?
Why don't you just use REPLACE and then (assuming no error occurred)
check the value of mysql_affected_rows()?
Paul DuBois, paul@stripped