Re: 1062 Duplicate entry '0' for key 1

Originally Posted by
adanker
As you can probably tell my issue with savannahspasecrets.com has been resolved. For the duplicate entry error message that I received I simply compared the original sql file that built the original tables for the database to the errored database. I found that for every "key" ID I was missing the auto-increment setting. In this case upon every new data entry to what ever table it was trying to start from "0" and then the following new row written would try to write over this same row key value with "0"... kicking back to the script a <b>1062 Duplicate entry '0' for key 1</b> error! Bingo, this solution has been working for my zen-cart for 2 weeks now.
Good luck, I will try to help anyone else if their situation is a bit different.
Aaron
would be cool if someone posted an SQL patch to fix alll auto_increment collumns that are not auto_increment now...
or is there a better way to do it, without screwing up your migrated data?
I fixed the one in the admin activity log, but i have to fix it in the other tables too... the banner history log i guess... (when the error shows up on the bottom of the page on the main site)
Code:
ALTER TABLE admin_activity_log CHANGE COLUMN log_id log_id int(15) NOT NULL auto_increment;
ALTER TABLE banners_history CHANGE COLUMN banners_history_id banners_history_id int(11) NOT NULL auto_increment;
probably need to edit other tables with history in it...
e.g. orders_status_history, paypal_payment_status_history, project_version_history
Last edited by Vixay; 3 Jun 2006 at 05:50 AM.
--
"Drunk on the Nectar of Life" - me
Bookmarks