in reply to INSERT or UPDATE, but only when unique

jZed's got the right anwer, see below.

You could define this column as UNIQUE in MySQL, and if the INSERT fails, check if it failed because of a duplicate key. In this case, update the record.

  • Comment on Re: INSERT or UPDATE, but only when unique