xcandiottix Posted March 23, 2010 Share Posted March 23, 2010 All of a sudden if I go to submit something to my database I get the error: Duplicate entry '0' for key 1 I notice that my last submission into the data base has a primary key of 0 ... even though the one before it is 49. If I go to enter a second submission, I get the error. If I delete the submission with a primary key of 0 I can submit again, but it submits with a key of 0 and i'm back to where I started... what's gone wrong?? Quote Link to comment https://forums.phpfreaks.com/topic/196192-what-the-duplicate-entry-0-for-key-1/ Share on other sites More sharing options...
MadTechie Posted March 23, 2010 Share Posted March 23, 2010 You probably don't have the primary set to AUTO_INCREMENT Quote Link to comment https://forums.phpfreaks.com/topic/196192-what-the-duplicate-entry-0-for-key-1/#findComment-1030306 Share on other sites More sharing options...
xcandiottix Posted March 23, 2010 Author Share Posted March 23, 2010 I just double checked that and youre right. Stupid question i guess. The weird thing was I hadn't logged into the mysql admin to change that or turn it off. Strange. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/196192-what-the-duplicate-entry-0-for-key-1/#findComment-1030307 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.