[SOLVED] id has a 127 key limit?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Linkjames
Forum Commoner
Posts: 90
Joined: Tue Sep 16, 2003 8:39 am

[SOLVED] id has a 127 key limit?

Post by Linkjames »

My MySql database is refusing to let my key go above 127. If I set it to index it will accept all my entrys (About 800) but gives them individual id keys for the first 127, then numbers the rest as 127 also.

If I then try and set it to unique (With all 800 entrys in the database I get the error

Code: Select all

#1062 - Duplicate entry '127' for key 1
any ideas?
Thanks guys and gals
LinkJames
Last edited by Linkjames on Tue Jul 06, 2004 7:44 am, edited 1 time in total.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

You need to change your column type to something other than a 'tinyint'
Linkjames
Forum Commoner
Posts: 90
Joined: Tue Sep 16, 2003 8:39 am

Post by Linkjames »

What I love about this forums is that I will struggle with a problems for half a day, admit defeat and post it here, then solve it myself within 30 mins. :D

The problem was I was using a signed tinyint which only holds 127 plus and minus. Prat :)

Cheers anyway guys
LinkJames

*Edit* Didn't see your reply untill I posted this redmonkey, damn your fast :) but you are exactly right. Thank you very much for helping, much appreciated
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

Linkjames wrote:The problem was I was using a signed tinyint which only holds 127 plus and minus. Prat :)
Actually its from -128 to +127 :wink: but yes that was the problem.
Post Reply