Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    96
    Plugin Contributions
    0

    Default 1062 Duplicate entry after db install is it auto-increment settings?

    Hi,
    everytime I try to add a product to a category I get this error

    1062 Duplicate entry '135-1' for key 1
    in:
    [insert into products_description (products_name, products_description, products_url, products_id, language_id) values ('hot rod', 'blah nlah', '', '135', '1')]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


    after canceling the product, another product from another category appears

    eg entering product in cat #15, error ocurrs then shows product number from cat #1

    Im thinking somewhere in the script it is not reading the new categories correctly, reading all new ones that I havnt uploaded and added to cat #1
    Im not very good at script so not sure even where to look

    I have done the following

    - installed 1.3.8a (new database)
    - uploaded old database files 1.3.7 to new database 1.3.8a (used winmerged and checked each table indivualy, had to delete zen_ in all tables to match current prefix)
    - add ons - catergories dressing

    Im not sure if my auto-increment settings were ticked when saving the database, which could be causing the problem

    Im thinking of doing 3 different thing , advise in needed

    1 - reinstall and upload database again

    2 - do what is suggested on this thread
    http://www.zen-cart.com/forum/showthread.php?t=88052
    (not sure if it will help me)

    3 - of insert this patch that I have found in a old forum thread 2006 (not sure it is compatable with 1.3.8a)

    patch below

    Code:
    # This script simply rebuilds the auto-increment settings on tables which should have them.
      
      ALTER TABLE upgrade_exceptions CHANGE COLUMN   upgrade_exception_id  upgrade_exception_id smallint(5) NOT NULL auto_increment;
      ALTER TABLE address_book CHANGE COLUMN address_book_id  address_book_id int(11) NOT NULL auto_increment;
      ALTER TABLE address_format CHANGE COLUMN   address_format_id  address_format_id int(11) NOT NULL auto_increment;
      ALTER TABLE admin CHANGE COLUMN   admin_id  admin_id int(11) NOT NULL auto_increment;
      ALTER TABLE admin_activity_log CHANGE COLUMN   log_id  log_id int(15) NOT NULL auto_increment;
      ALTER TABLE authorizenet CHANGE COLUMN id  id int(11) unsigned NOT NULL auto_increment;
      ALTER TABLE banners CHANGE COLUMN   banners_id  banners_id int(11) NOT NULL auto_increment;
      ALTER TABLE banners_history CHANGE COLUMN   banners_history_id  banners_history_id int(11) NOT NULL auto_increment;
      ALTER TABLE categories CHANGE COLUMN   categories_id  categories_id int(11) NOT NULL auto_increment;
      ALTER TABLE configuration CHANGE COLUMN   configuration_id  configuration_id int(11) NOT NULL auto_increment;
      ALTER TABLE configuration_group CHANGE COLUMN   configuration_group_id  configuration_group_id int(11) NOT NULL auto_increment;
      ALTER TABLE countries CHANGE COLUMN   countries_id  countries_id int(11) NOT NULL auto_increment;
      ALTER TABLE coupon_email_track CHANGE COLUMN   unique_id  unique_id int(11) NOT NULL auto_increment;
      ALTER TABLE coupon_gv_queue CHANGE COLUMN unique_id  unique_id int(5) NOT NULL auto_increment;
      ALTER TABLE coupon_redeem_track CHANGE COLUMN unique_id  unique_id int(11) NOT NULL auto_increment;
      ALTER TABLE coupon_restrict CHANGE COLUMN restrict_id  restrict_id int(11) NOT NULL auto_increment;
      ALTER TABLE coupons CHANGE COLUMN coupon_id  coupon_id int(11) NOT NULL auto_increment;
      ALTER TABLE currencies CHANGE COLUMN currencies_id  currencies_id int(11) NOT NULL auto_increment;
      ALTER TABLE customers CHANGE COLUMN customers_id  customers_id int(11) NOT NULL auto_increment;
      ALTER TABLE customers_basket CHANGE COLUMN customers_basket_id  customers_basket_id int(11) NOT NULL auto_increment;
     ALTER TABLE customers_basket_attributes CHANGE COLUMN customers_basket_attributes_id customers_basket_attributes_id int(11) NOT NULL auto_increment;
      ALTER TABLE email_archive CHANGE COLUMN archive_id  archive_id int(11) NOT NULL auto_increment;
      ALTER TABLE featured CHANGE COLUMN featured_id  featured_id int(11) NOT NULL auto_increment;
      ALTER TABLE files_uploaded CHANGE COLUMN files_uploaded_id  files_uploaded_id int(11) NOT NULL auto_increment;
      ALTER TABLE geo_zones CHANGE COLUMN geo_zone_id  geo_zone_id int(11) NOT NULL auto_increment;
      ALTER TABLE group_pricing CHANGE COLUMN group_id  group_id int(11) NOT NULL auto_increment;
      ALTER TABLE ezpages CHANGE COLUMN pages_id  pages_id int(11) NOT NULL auto_increment;
      ALTER TABLE languages CHANGE COLUMN languages_id  languages_id int(11) NOT NULL auto_increment;
      ALTER TABLE layout_boxes CHANGE COLUMN layout_id  layout_id int(11) NOT NULL auto_increment;
      ALTER TABLE manufacturers CHANGE COLUMN manufacturers_id  manufacturers_id int(11) NOT NULL auto_increment;
      ALTER TABLE media_clips CHANGE COLUMN clip_id  clip_id int(11) NOT NULL auto_increment;
      ALTER TABLE media_manager CHANGE COLUMN media_id  media_id int(11) NOT NULL auto_increment;
      ALTER TABLE media_types CHANGE COLUMN type_id  type_id int(11) NOT NULL auto_increment;
      ALTER TABLE meta_tags_categories_description CHANGE COLUMN categories_id  categories_id int(11) NOT NULL auto_increment;
      ALTER TABLE meta_tags_products_description CHANGE COLUMN products_id  products_id int(11) NOT NULL auto_increment;
      ALTER TABLE music_genre CHANGE COLUMN music_genre_id  music_genre_id int(11) NOT NULL auto_increment;
      ALTER TABLE newsletters CHANGE COLUMN newsletters_id  newsletters_id int(11) NOT NULL auto_increment;
      ALTER TABLE orders CHANGE COLUMN orders_id  orders_id int(11) NOT NULL auto_increment;
      ALTER TABLE orders_products CHANGE COLUMN orders_products_id  orders_products_id int(11) NOT NULL auto_increment;
     ALTER TABLE orders_products_attributes CHANGE COLUMN orders_products_attributes_id orders_products_attributes_id int(11) NOT NULL auto_increment;
     ALTER TABLE orders_products_download CHANGE COLUMN orders_products_download_id orders_products_download_id int(11) NOT NULL auto_increment;
     ALTER TABLE orders_status_history CHANGE COLUMN orders_status_history_id orders_status_history_id int(11) NOT NULL auto_increment;
      ALTER TABLE orders_total CHANGE COLUMN orders_total_id  orders_total_id int(10) unsigned NOT NULL auto_increment;
      ALTER TABLE paypal_session CHANGE COLUMN unique_id  unique_id int(11) NOT NULL auto_increment;
    any help would be appreciated

    unfinished test store - http://www.rubirocket.com/shop

    brooke ox

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: 1062 Duplicate entry after db install is it auto-increment settings?

    Check via phpMyAdmin that the products_description table is properly setup with the products_id as auto_increment ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    96
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry after db install is it auto-increment settings?

    I think im looking in the correct place

    under the extras column there is only auto_increment marked next to products id, not any other product tables

    thanks for ur fast reply, how can I fix this?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: 1062 Duplicate entry after db install is it auto-increment settings?

    You should back up your database before fixing things ...

    One of the better backup methods is to use the Backup SQL add-on that DrByte wrote ...

    Then, make sure you are looking at the structure of the products_description table ...

    Make sure you see the products_id ...

    If you do not have auto_increment in the Extras column then you need to edit that field (should be a little pencil on that line) and select auto_increment in the Extras column and save the change ...

    If you do have this already, then you want to check the products table and make sure that it too has the products_id set for auto_increment ...

    If both tables have the auto_increment set ... then I would start to wonder if you have an error on your data that has caused this problem and thrown the tables out of sync with one another ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    96
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry after db install is it auto-increment settings?

    thankyou, I will give it ago

    Ill post how I go, it may take me awhile :)

  6. #6
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    96
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry after db install is it auto-increment settings?

    Well couldnt get that to work so im going to try to do a total re-upload of database and make sure all the correct boxes are ticked.

    Also Im not sure if i can use

    Dr bytes backup mysql pluggin as there is no version for 1.3.8a, I dont like using ones that havnt been updated incase I case more harm than good :)I will the thread updated incase others have the same problem

  7. #7
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    96
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry after db install is it auto-increment settings?

    UPDATE for anyone having similar problems

    ok I had to do

    -reinstall a new cart
    -backup my origional store again using this tutorial

    https://www.zen-cart.com/tutorials/i...hp?article=103

    (before i used a different tut, sorry cant find the link, but it said to only tick certain boxes not auto-increment so I redid my origional db backup from scratch

    - checked files with winmerge (i love this)
    - re uploaded new database in new cart db
    - checked to see if products where all there YES
    - checked to see if I could add categories & products YES
    - installed catergory grid addon & redid the above
    - installed category dressings & redid the above

    All seems fine, so Im sure it was he auto-increment settings not backup in the first place, please check this if u r havin the same problem.

    cheers and thankyou Ajeh once again







 

 

Similar Threads

  1. Replies: 6
    Last Post: 13 Feb 2013, 06:35 AM
  2. 1062 Duplicate entry
    By pkohn11 in forum General Questions
    Replies: 4
    Last Post: 5 Apr 2011, 09:09 PM
  3. Replies: 37
    Last Post: 7 Jul 2008, 07:17 PM
  4. Replies: 5
    Last Post: 8 Apr 2008, 02:52 PM
  5. '1062 Duplicate entry '0' for key 1' after payment process
    By targetsp in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 18 May 2006, 03:37 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR