Heelo. I'm using a MySQL db, and I have an auto_increment line called id, as well as a bunch of other columns (varchar, into, etc.)
The problem is, I went up to 127 rows (113 in actuality, 127 by the id numbers), and it refuses to add the 128th. It says:
Duplicate entry '127' for key '1'
I have no idea what that means, but i can't insert rows through my scripts, not through PHPmyADMIN. The max_rows is set to 10 000. What should I do?
Cheers!
MySQL Insert Problems
Moderator: General Moderators
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
- dstefani
- Forum Contributor
- Posts: 140
- Joined: Sat Jan 11, 2003 9:34 am
- Location: Meridian Idaho, USA
Are you trying to insert a value into the auto_increment column?
If you are, then this is most likely your problem.
An insert into a table like this should start like:
insert into TABLENAME values(' ', col_2, col_3, etc...
The first insert value must be an empty value since the "auto" of the auto increment will do the rest.
I hope this helps.
Don
If you are, then this is most likely your problem.
An insert into a table like this should start like:
insert into TABLENAME values(' ', col_2, col_3, etc...
The first insert value must be an empty value since the "auto" of the auto increment will do the rest.
I hope this helps.
Don
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
It may be that you are using a TINYINT field to store the autoincrement value. If so then the problem is that a TINYINT field can only store values up to 127 - you probably just need to change your field to a SMALLINT or MEDIUMINT field, depending on how big it will need to be able to grow.
For more info:
http://www.mysql.com/doc/en/Numeric_types.html
Mac
For more info:
http://www.mysql.com/doc/en/Numeric_types.html
Mac