CREATE TABLE custinfo 
(  
        id tinyint(4) DEFAULT '0' NOT NULL AUTO_INCREMENT,
        ....
);

1.  Your primary key is on a TINYINT field.

        If TINYINT is SIGNED, 
                possible values are... -127 to +127
        If TINYINT is UNSIGNED
                possible values are... 0 to 255

Seems to me that you've got to 127 already and "are going" around again.

If you expect more than 128 records, then why would you use TINYINT?

Why would you set your default value on a primary key to 0 when using 
auto_increment?

Maybe your table definition should be....

CREATE TABLE custinfo 
(  
        id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
        ....
);


-----Original Message-----
From: Steven Fruchter [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 09, 2001 1:47 PM
To: [EMAIL PROTECTED]
Subject: Please HELP easy ANSWER


Hi Everyone,
    I have a big problem, that I bet could be solved pretty simply but I am
new to mysql so its killing me and my database.

    Ok heres the problem, suddenly out of no where when my php script tries
to (or manually) do a insert it says:

    ERROR 1062: Duplicate entry '127' for key 1


Now why all of a sudden is this doing this at id 127?

This is what my create table statement looks like if this is of any help to
you:

    CREATE TABLE custinfo (  id tinyint(4) DEFAULT '0' NOT NULL
AUTO_INCREMENT, date date, name varchar(50), card varchar(22), exp_date
varchar(7), authcode varchar(8), amount double(4,2), tax double(3,2), pnref
varchar(16), address text, city tinytext, state varchar(
3), zip varchar(15), country varchar(2), contact_first varchar(20),
contact_last varchar(20), contact_phone varchar(20), contact_ema
il tinytext, tickets tinyint(3), description varchar(50), PRIMARY KEY (id),
UNIQUE id (id));

Now after I got this message these are some of the things I have tried to
solve the problem but of course had no success:

    I tried isamchk -r and -R, i have even tried it with -rkis and then just
plain -kis i pretty much have tried them all and it still gives the same
error when i try to insert anything into the list ?  What do i do to fix it
and what did i do to cause it?  Please help me I need this database up and
running (loosing money every hour its down!)
:(   please please please help thank you very much for your time and help.

-Steven


Steven Fruchter
Chief Technology Officer
SMR Studios, Inc.
[EMAIL PROTECTED]
http://www.smrstudios.com


---------------------------------------------------------------------
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

---------------------------------------------------------------------
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