Hi. This is my first post, so I'd like to say thank you to the folks that provide this great resource. I am having a weird issue with PHP/MySQL. MySQL is adding a submitted record from a form multiple times. I know this is a relatively common problem that is seemingly virtually always due to errors in the code. However, this situation is slightly different. What is happening is the duplication is sometimes happening AFTER the initial submission, and AFTER additional records are successfully submitted.
So, for example, INSERT will add record with ID 123, then add 124, 125, 126, and then out of nowhere, record 127 will be identical to 123. Granted, it doesn't ALWAYS happen in this manner, but it often does.
Also, there's zero consistency to this dilemma. It doesn't happen with every record. It doesn't always limit itself to mere duplication. Sometimes, a record will end up in the database 3 or 4 times. I started including a unix timestamp of the moment of insert to try and track how far apart these inserts are occurring, and sometimes they're up to 25 minutes apart!
As everyone says....I've examined my code pretty thoroughly. It's as straightforward as can be. I'm the only person using the form, so I can ensure there's no hyperclicking going on. There's no javascript or other form of validation (I wrote it quick and dirty to get a bunch of data added swiftly, and this is what I get!). Just a GET to a script that runs the INSERT statement, then pushes the user back to the form with "header("location: ...")".
Any suggestions? I'm hoping someone is aware of something right off the bat that I'm not aware of regarding what I've described. I will post my code if needed.
Thanks
Brian