Zen Cart Logo
Forums / Managing Customers and Orders / 1062 Duplicate entry '2147483647' for key 1

1062 Duplicate entry '2147483647' for key 1

Locked

Views: 2,881

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
12 Jul 2009, 4:08 PM
#1
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

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.

12 Jul 2009, 4:55 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

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)

12 Jul 2009, 6:26 PM
#3
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: 1062 Duplicate entry '2147483647' for key 1

Kim:

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.

12 Jul 2009, 6:28 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

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?

12 Jul 2009, 8:53 PM
#5
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: 1062 Duplicate entry '2147483647' for key 1

Kim:

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.

12 Jul 2009, 9:15 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

12 Jul 2009, 9:15 PM
#7
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

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.

12 Jul 2009, 10:09 PM
#8
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: 1062 Duplicate entry '2147483647' for key 1

Kim:

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.

13 Jul 2009, 5:02 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

13 Jul 2009, 11:07 AM
#10
shoesbuyonline avatar

shoesbuyonline

New Zenner

Join Date:
May 2009
Posts:
78
Plugin Contributions:
0

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,

13 Jul 2009, 7:17 PM
#11
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: 1062 Duplicate entry '2147483647' for key 1

Appreciate the input, but don't want to do random numbers. Going to create a new table at a later date to hold the current variables for last order number, current year, etc...

:D

But I do like it that I know what the cause was to this issue. I could of also resolved it by changing the variable type from int(11) to something bigger. But in reality the order number format I want to use is really a string and not an integer so going to be a future project of mine.

The quick responses of all concerned with this issue got me back up and running though...and pulling in a lot of international sales for arcadem pro software products (not the same as Agares Media Arcadem Pro website, though an official download website for them.). In my experience the responses in here have been rather piecemeal lately, but this one was right to the point and very helpful.

Thanks to all.