Edward Posted August 30, 2007 Share Posted August 30, 2007 Hi, I have an 'id' column in my table which is set to auto_increment. I was working fine, assigning '1' to the first entry, '2' to the id of the next, etc. But for the last few they have all been assigned an 'id' on 127! Please can someone tell me why?? More importantly, can someone tell me the best way to fix these rows and any future rows. The database is live and new rows are being entered. Please can someone help me. Thank you. Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 30, 2007 Share Posted August 30, 2007 Change the database definition of the auto-increment field from tinyint to smallint. Tinyint has a limit of 128 (0-127) Quote Link to comment Share on other sites More sharing options...
Edward Posted August 30, 2007 Author Share Posted August 30, 2007 Thank you! Does smallint have as limit? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 30, 2007 Share Posted August 30, 2007 smallint has limit between 0 and 32767. For columns which use auto_increment I always use INT(11) Have a look at the following MySQL Cheat Sheet to see what each data type's limit/capacity. Quote Link to comment 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.