> Fra: Henning Olsen [mailto:[EMAIL PROTECTED]]
> Sendt: 19. april 2002 14:39

> Hey - can anyone help?
> I have a MySql-db in which I can only have 127 records.
> Using phpmyadmin to insert record number 128 (autoincrement) gets
> this message:
>
> INSERT INTO `kontakt` (`id`, `navn`, `adresse`, `postnummer`,
> `by`, `telefon`, `kommentar`) VALUES ('', 'fsd', 'sfdg', 'sg',
> 'fdsg', 'sfg', 'sg');
>
> MySQL returnerede:
>
> Duplicate entry '127' for key 1

This is a classic :-)

You've created your primary key (the autoincremented field) as a TINYINT,
which only allows values in the range -128 to 127. auto_increment does not
support negative numbers, so when you've filled the first 127 records, it
cannot add any more values.

Alter the field to a INT UNSIGNED, then you're good to go

- Carsten



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to