MySQL Forums
Forum List  »  Newbie

Unwanted multiple inserts: Should I use insert or replace into?
Posted by: jason robinson
Date: October 19, 2010 10:11AM


I've encountered a strange result with an app I built. For some strange reason (first time after hundreds of inserts) one of my tables has an entry inserted multiple times. It should have done it only once. I have a datestamp on my records and the inserts happened at the exact same time. I do have a primary key – in this case on the memberID.

I'm wondering a)why would this occur and b) how do I prevent this from occurring?

I've read that I could consider using REPLACE INTO instead of INSERT but I'm hoping to understand the issue first before implementing this potential solution.

If it matters at all, I'm using ColdFusion as my server-side code.

Thanks in advance to anyone who can provide some insight.


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.