Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / 1062 duplicate entry 51 for key 1 (customers_info table)

1062 duplicate entry 51 for key 1 (customers_info table)

Locked

Views: 6,482

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
24 Sep 2006, 9:01 AM
#1
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

1062 duplicate entry 51 for key 1 (customers_info table)

hi all

Given that I had no luck with fixing this issue, noted in thread below!!

http://www.zen-cart.com/forum/showthread.php?t=46958

i decided to start all over again. This time I copied my entire 1.3.2 live cart over to another folder on the root of my site.

i then installed my database from my live site over to a new database and made the adjustments to configure files and so on. That all went fine

I then upload the new 1.3.5 files to the new folder containing the copied live site and over wrote the old files. That went fine!

I then ran the zc_install file on the newly created folder containing my live cart, which I will now refer to as my test site!!

I chose update database as I was only updating the live database which was copied to a new empty database. So far so good.

So now I am in the process of testing everything,

first test - create account. fail (sought of)

Problem:

I receive this message when I hit the submit button to create an account -

1062 Duplicate entry '53' for key 1
in:
[insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('53', '0', now())]

But even though this error page shows up, the account is still created.

I have tried to create 3 separate accounts and they all end up with the same results

It is obviously a database problem, but I am not sure where to look or what in the database needs attention!!

Is there anyone that can help! please!

URL to Test Site

25 Sep 2006, 8:15 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

it would appear that your customers_info table is not properly in sync with your customers table, and possible therefore also not in sync with your address_book table.

25 Sep 2006, 8:43 AM
#3
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Thanks Doc

Any idea on how to fix problem!!

TIA

25 Sep 2006, 10:57 PM
#4
robwuk avatar

robwuk

Zen Follower

Join Date:
Aug 2005
Location:
United Kingdom
Posts:
458
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

i had this problem but with a different table, it was due to me exporting my database and selecting a compatability mode, if you are transferring the database into a new one on the same hosting account then dont set a compatibility mode when exporting

Rob

(just to let you in my case in the EXTRA field i was missing the AUTO INCREMENT value and therefor mine was trying to insert over a key that was already there

Rob

Moderator note: There is a special .SQL file in the /zc_install/sql folder which you can use to rebuild your auto-increment settings for the core Zen Cart tables.

25 Sep 2006, 11:36 PM
#5
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Hi Rob

Thanks for response. Could I ask what you mean by compatiblity mode?

Below are my settings for exporting

Format - SQL
SQL Options -Structure

Add DROP TABLE - Checked
Add AUTO_INCREMENT value - Checked

Data
Complete inserts - checked
Extended inserts - checked
Maximal length of created query: 50000
Use hexadecimal for binary fields - checked
Export type - INSERT

SAVE FILE AS

G-ZIPPED COMPRESSION

all other fields are not checked when exporting

TIA

26 Sep 2006, 7:00 PM
#6
robwuk avatar

robwuk

Zen Follower

Join Date:
Aug 2005
Location:
United Kingdom
Posts:
458
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Hi there, what im describing is an option when exporting your database.

When you view databse in phpmyadmin you will have an export tab, when this is selected (on my version) i have a list of options on the right, 'add drop table, add if not exists etc etc there is one called SQL Export Compatibility and this usually is set to none, when in mycase i was selecting 'MYSQL40' and this that was causing problems with my database, it was removing the AUTO INCREMENT from the fieilds in the tables.

BUT becasue i was inserting the data into another table on the same hosting account i didnt need to set this to anything.

Why i had been setting it to the above before was there was a version difference between mysqls on old and new server

Rob

27 Sep 2006, 1:24 AM
#7
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Thanks Rob

After your explaination, This is not what my problem is, as when exporting my database, I have the option AUTO INCREMENT which I make sure is checked.

There has to be something in the 1.3.2 - 1.3.5 update mysql file causing this, but I am not sure what.

If any of the devs could help, it would be much appreciated! :unsure:

27 Sep 2006, 2:45 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

heavenlynights:

Thanks Doc

Any idea on how to fix problem!!

TIA
Sure -- a long laborious manual record-by-record comparison of all those tables.

The problem should not happen.

There are no simple answers that can be posted here.

The upgrade for 1.3.0.2 to 1.3.5 does nothing to those tables. Perhaps the problem is with the backup you made and the subsequent import process?

27 Sep 2006, 2:58 AM
#9
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Thanks doc :down: :cry:

Looks like I am going to have to start all over again for the 5th time, starting with a fresh install of 1.3.5, comparing files, uploading templates, uploading mods etc etc. and then find I have a problem the field STATE in create account page again :censored:

NOT AIMING MY FRUSTRATION AT U DOC!!

27 Sep 2006, 3:26 AM
#10
drbyte avatar

drbyte

Sensei

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

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

The problem you're reporting doesn't appear to be related to files. It is almost certainly with database content.

Try doing a fresh backup of your 1.3.0.2 database, then drop all the tables in your temporary 1.3.5 database, and re-import from your fresh backup.

If the problem persists, then use phpMyAdmin to "empty" the 3 tables, and attempt creating an account again. In fact, you could test this before dumping and re-loading the database.

  • customers_info
  • customers
  • address_book
27 Sep 2006, 3:48 AM
#11
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

DrByte:

Try doing a fresh backup of your 1.3.0.2 database, then drop all the tables in your temporary 1.3.5 database, and re-import from your fresh backup.

Done this several times already and have always come up with the same result

I have that many backup databases and complete carts on my desktop and elsewhere on my pc it's not funny. I am going to have to do a major cleanup of pc when this is all finished :lol:

If the problem persists, then use phpMyAdmin to "empty" the 3 tables, and attempt creating an account again.

In fact, you could test this before dumping and re-loading the database.

  • customers_info
  • customers
  • address_book

just tried this but didn't make any difference :down:

29 Sep 2006, 3:53 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

I have installed the copy of your database that you sent me.
Pointed my configure.php file to use that database.
Fired it up and created accounts without any problem.

I suspect something must be wrong with a file somewhere...

8 Oct 2006, 2:21 AM
#13
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Thanks for your all your help doc.

Problem resolved. Ended up being a conflict in regard to the "how did you hear about us" contrib. Not exactly sure what it was in that contrib that caused it, but ended up removing this mod and wha la no more problem. :smile:

8 Dec 2008, 1:03 PM
#14
93_s13 avatar

93_s13

New Zenner

Join Date:
Oct 2007
Posts:
4
Plugin Contributions:
0

Re: 1062 duplicate entry 51 for key 1 (customers_info table)

Don't mean to resurrect an old thread, but I'm having the same exact problem. When a new user signs up for an account, I get this error:

1062 Duplicate entry '3151' for key 1
in:
[insert into zc_customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('3151', '0', now(), '1')]

I just finished installing the "Where did you hear about us" module and now this is happening. I think I've narrowed it down to the 'create_account.php' file located in the 'store/includes/modules...' directory. I put the original file back up adn the error goes away, but I put the referal module one back in and I get the error again. The SQL in the error message is found right at about line 315 on the modified create_account.php file. Any ideas on what it could be? I'm on Zen Cart 1.3.8. My site is https://www.justgastanks.com.

Oh, and the account does get created, it's just we get that error on a blank screen...Any advise would be greatly appreciated...
Thanks,