Duplicate inserts on mysql
Posted on 2011-03-08
I am trying to solve an issue with my application but can't find the way:
I have the following mysql table:
entry_id int(11) Autoincrement
Now, many times records are saved at exactly the same time with the same details but the entry_id.
So the exact record could be stored several times, with the same camp_id, date and ip. However, I would like to avoid saving it more than once.
I tried INSERT IGNORE, but as the entry_id is different it does not work. Is there a way to use INSERT IGNORE but only checking the camp_id, date and ip?