Arghh, what is happening?
I thought I had grasped most things in MySQL but now I've come to a huge wall and I really need help.
I've set up several database and all have the same problem. When they come to an entry with ID=127 they won't acceppt any more entries. It's like the Auto-incrementation is stuck at 127. The error that MySQL reports when you try to add another post is:
"MySQL said: Duplicate entry '127' for key 1"
Even when I specify the ID to a number higher than 127 it still says the same thing.
It's clear that I've forgot something important when setting up databases/tables and the keys.
Can anyone shed some light on this problem??
Some background how the tables are set up:
I use phpmyAdmin to set up most tables because it's quick. I choose the first fields to be the Auto-incremented ID (I name it pID, nID etc.). Since I have not been really sure on how keys and indexes work I haven't touch anything else.
I jsut did a test. I created a database with 1 table called test. This table have 3 fields which were created with phpMyadmin.
Filed 1, pID, is set to auto_increment. I think it thus also becomes the Primary Key automatically.
I then inserted a post and set the value directly to 127. This worked. However - from now on I can't insert anything more into the table since it reports "Duplicate Entry .. " and so on.
This is the code MySQL uses:
CREATE TABLE test (
pID tinyint(4) NOT NULL auto_increment,
Filed1 tinyint(4) DEFAULT '0' NOT NULL,
Field2 tinyint(4) DEFAULT '0' NOT NULL,
UNIQUE pID (pID)
);
Using this I get a table that won't let me add something after piD 127 .....
Help??
/Bj鰎n
I thought I had grasped most things in MySQL but now I've come to a huge wall and I really need help.
I've set up several database and all have the same problem. When they come to an entry with ID=127 they won't acceppt any more entries. It's like the Auto-incrementation is stuck at 127. The error that MySQL reports when you try to add another post is:
"MySQL said: Duplicate entry '127' for key 1"
Even when I specify the ID to a number higher than 127 it still says the same thing.
It's clear that I've forgot something important when setting up databases/tables and the keys.
Can anyone shed some light on this problem??
Some background how the tables are set up:
I use phpmyAdmin to set up most tables because it's quick. I choose the first fields to be the Auto-incremented ID (I name it pID, nID etc.). Since I have not been really sure on how keys and indexes work I haven't touch anything else.
I jsut did a test. I created a database with 1 table called test. This table have 3 fields which were created with phpMyadmin.
Filed 1, pID, is set to auto_increment. I think it thus also becomes the Primary Key automatically.
I then inserted a post and set the value directly to 127. This worked. However - from now on I can't insert anything more into the table since it reports "Duplicate Entry .. " and so on.
This is the code MySQL uses:
CREATE TABLE test (
pID tinyint(4) NOT NULL auto_increment,
Filed1 tinyint(4) DEFAULT '0' NOT NULL,
Field2 tinyint(4) DEFAULT '0' NOT NULL,
UNIQUE pID (pID)
);
Using this I get a table that won't let me add something after piD 127 .....
Help??
/Bj鰎n