Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default 1062 Duplicate entry '2147483647' for key 1

    HELP!!!

    I am getting 1062 Duplicate entry '2147483647' for key 1 when a customer attempts to confirm any order. It appears that the roder id is stuck on this number and not autoincrementing. I search the threads and can't find the solution for this and it is rather urgent as my website is virtually shut down because of this error.

    Please advise.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    Did you modify/reset the order numbers to be a huge number?

    ( look in the similiar threads section at the bottom of this page for more information)
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    Quote Originally Posted by Kim View Post
    Did you modify/reset the order numbers to be a huge number?

    ( look in the similiar threads section at the bottom of this page for more information)

    Nope well kinda, but the behavior of that is not what you would expect... once I tested successful orders, I set the counter to 2008999999, but the very next order the order number was 2147483647 which is the max mysql auto increment for int(11) fields.

    I deleted the table data through phpMyAdmin and reset the counters to 1. I wanted the orders to be in 8-10 digit format, but appears it will not work with Zen Cart.

    I went through previous posts and that is like looking for a needle in a haystack for the answer, plus too many off-topic responses and similiar but unrelated posts make it next to impossible to find what I need.

  4. #4
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    I wanted the orders to be in 8-10 digit format,
    Why do you think you need such a large format?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  5. #5
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    Quote Originally Posted by Kim View Post
    Why do you think you need such a large format?
    Looking for a way to assign numbers based on the year they are initiated in. I don't have to go that big, just what I did to make the error happen.

    I run a software download site for Arcadem Pro arcade game script and the potential for high number of orders in such a targeted website is huge. Especially when I am currently the only one besides Agares Media to legally make the software downloadable. So I wanted to start out with potential for the number of orders in a year to be upto 1 million orders. The free software orders will take the bulk of that.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    If that's important to you, I would suggest using a 1-digit year code, instead of 4 digits.
    Or, simply edit the code (numerous places) to always output a prefix on all order numbers, and then change that prefix from time to time, ie: annually.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    The order numbers are meant to be a simple auto-incremented number. You can do some custom coding to append a certain fixed number to the order number though.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  8. #8
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    Quote Originally Posted by Kim View Post
    The order numbers are meant to be a simple auto-incremented number. You can do some custom coding to append a certain fixed number to the order number though.
    Probably do that later through two new fields. One with a prefix and one with order number linked to a master table which shows the next order number to be used. I would need the order number to restart at one at the change of the new year.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    The upcoming v2.0 has some built-in support for prefixes and suffixes on order number displays ... however it is intended more for distinguishing orders in one store from orders in another store moreso than injecting a certain sequence during certain times of the year.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10

    Default Re: 1062 Duplicate entry '2147483647' for key 1

    I have encounter a same problem. I resolved it using below fomula: yymmdd+4 random digits:

    $t1 = date("ymd");
    srand ((float) microtime() * 10000000);
    $input = array ("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
    $rand_keys = array_rand ($input, 3);
    $l1 = $input[$rand_keys[0]];
    $l2 = $input[$rand_keys[1]];
    $l3 = $input[$rand_keys[2]];
    $r1 = rand(0,9);

    $ordernum = $t1.$l1.$l2.$l3.$r1;

    Wish this would help,

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 PHP Fatal error 1062: Duplicate entry '2147483647' for key 1
    By NoobGal in forum General Questions
    Replies: 5
    Last Post: 20 Jan 2013, 05:36 PM
  2. Problem : 1062 Duplicate entry '2147483647'
    By sjbglx in forum General Questions
    Replies: 8
    Last Post: 4 Mar 2011, 08:31 PM
  3. 1062 Duplicate entry '2147483647' for key 1
    By bblue03 in forum General Questions
    Replies: 2
    Last Post: 9 May 2008, 10:02 PM
  4. 1062 Duplicate entry '2147483647' for key 1
    By bblue03 in forum General Questions
    Replies: 2
    Last Post: 9 May 2008, 07:38 PM
  5. 1062 Duplicate entry '2147483647' for key 1
    By wheat in forum Setting Up Categories, Products, Attributes
    Replies: 13
    Last Post: 1 Apr 2008, 07:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg