It sounds like the data type of your id field is a signed tinyint,
which has a maximum value of 127. The range is -127 to 127 (or
something close to that). You need to change the data type. If you
make it unsigned it has a range of 0 to 255. If that isn't enough
you'll have to increase it to smallint.

I generally use unsigned integers as I rarely need to store minus
values (especially if they auto increment) and they take up less
database space. When you make the change from signed to unsigned in
your database clear down the size field as you do it. Depending upon
the tool you are using to manage your database (I use the excellent
Sequel Pro) it will default it to the smallest acceptable value.

On Nov 25, 5:51 am, TimG <[email protected]> wrote:
> I was inserting new rows through my application and then suddenly I
> started receiving this error:
>
> Warning (512): SQL Error: 1062: Duplicate entry '127' for key 1
> [CORE/cake/libs/model/datasources/dbo_source.php, line 525]
>
> The AUTO_INCRIMENT is set to 128 on the 'id' field and it was working
> perfectly until now. It seems stuck on trying to create id '127'. Any
> ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to