Add a field to your table called md5hash or something similar. Make this field unique. Then when adding a new record, concatenate the other fields into a string and md5 it. Then write the md5 hash into the md5hash field.
This way if the record already exists MySQL will ignore the duplicate entry.
July 30th, 2002 at 3:39 pm
i have been searching the net for a simple way to do this. thank you so
much!
cheers
christian
August 15th, 2002 at 4:40 pm
Yes,
because so far I did a SELECT statement first to check for duplicate entries, which creates almost the double work for the DB!
Now I can skip that.
August 16th, 2002 at 7:29 pm
The easy way is to do a
REPLACE into table (f1, f2, f3) Values(1,2,3)
That way if there is a duplicate, It will replace, otherwise it behaves like a INSERT.
-Byron Whitlock