Forums / General Questions / PHP Fatal error: 1062:Duplicate entry '613' for key 'PRIMARY' :: insert into custome

PHP Fatal error: 1062:Duplicate entry '613' for key 'PRIMARY' :: insert into custome

Views: 2,489

Results 1 to 3 of 3
11 Dec 2012, 12:51 AM
#1
pearcestephens avatar

pearcestephens

New Zenner

Join Date:
Nov 2012
Posts:
69
Plugin Contributions:
0

PHP Fatal error: 1062:Duplicate entry '613' for key 'PRIMARY' :: insert into custome

Guys, Im getting this strange error when somebody makes an account on my zen cart. It results in no shipping or billing address!

[11-Dec-2012 13:41:14] PHP Fatal error:  1062:Duplicate entry '613' for key 'PRIMARY' :: insert into customers_info

                          (customers_info_id, customers_info_number_of_logons,

                           customers_info_date_account_created, customers_info_date_of_last_logon)

              values ('613', '1', now(), now()) in website.com/includes/classes/db/mysql/query_factory.php on line 120

I dont think it is the query file is it? What would this mean?

Many thanks!!!

11 Dec 2012, 1:01 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: PHP Fatal error: 1062:Duplicate entry '613' for key 'PRIMARY' :: insert into custome

Customer data is stored in multiple tables: customers, customers_info, address_book, and has additional hooks to other places.

When a customer creates an account, new records are inserted into all of those tables. But in your case, the error is occurring because a record of that same number already exists. This usually only happens when someone does a mass delete or mass import of data from a small incomplete handful of tables instead of keeping the complete database intact when importing or exporting.

You'll need to sort out what's wrong in your database tables and sort out why it's already got records for customers that don't already exist.

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

11 Dec 2012, 2:58 AM
#3
pearcestephens avatar

pearcestephens

New Zenner

Join Date:
Nov 2012
Posts:
69
Plugin Contributions:
0

Re: PHP Fatal error: 1062:Duplicate entry '613' for key 'PRIMARY' :: insert into custome

DrByte,

Thank you for your reply. I found out the error was from the mod "how_did_you_hear_about_us_v150" which I obtained from the plugin section. I simply removed the code this plugin had written to my tpl_modules_create_account.php and create_account.php and things were back to normal.

Unsure if it was something I had done or was the plugin that caused the problem though.