TheDesignspace
mySQL error: duplicate entry '127' for key


August 03, 2007
Dreamweaver | PHP | Web Building

While working on a php insert-record form I was getting the error:


#1062 - Duplicate entry '127' for key 1

although there were no other records with the id "127" - just the latest one.

Thanks to jc_armor for the answer to this:
"quick question, what's the Data Type of your ID field? It could be a reason that the data type can only handle up to 127 :) "

Changing the field type to "unsigned INT" as recommended in the forum message made the error disappear.

http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html">MySQL Reference Manual: data types: numeric types

Posted by ellen at August 03, 2007 05:32 PM | TrackBack

 Comments
 Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?



Recommended Reading