in reply to Re: INSERT or UPDATE, but only when unique
in thread INSERT or UPDATE, but only when unique
The replace into is a nice thing, but remind that you need an id to check against and it is not cross-database capable.
So when making an database driven app, that might run on more databases, i'd avoid the use of a not standard sql statement like this one.
Why don't you just tell the database to create the field so that it only should contain unique values? then just use insert and update (catch the message of the database to see if insert went ok, else use update)