Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Fort Collins, CO :: Play Hockey eh?!
    Posts
    64
    Plugin Contributions
    0

    Default Can Not Add Option Name - SQL Error

    Created new Option Name (Color)
    Can not add Options Values (Green, Yellow etc.)
    Error:
    Code:
    1062 Duplicate entry '1-1' for key 1
    in:
    [insert into zen_products_options_values (products_options_values_id, language_id, products_options_values_name, products_options_values_sort_order) values ('1', '1', 'Green', '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.
    Tried running db_rebuild_autoincrement.sql by navigating to Tools>>Install SQL Patches (pasting into admin/sqlpatch.php). That generates this error:
    http://orchidsbymail.net/images/sqlErrors.gif

    Tried running db_rebuild_autoincrement.sql directly on the database and received the following error: http://orchidsbymail.net/images/sqlError-2.gif

    Ideas?

  2. #2
    Join Date
    Jul 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: Can Not Add Option Name - SQL Error

    Well, I had been facing the same problem of 1062 Duplicate entry for few days. I struggled a lot finding the fix to this but to my dismay neither could I find the correct fix in this forum nor elsewhere. To all you Zenners who are facing this problem, here's the solution:

    Most of these errors are caused when we accidentally try to delete or update an invalid entry. Or say if there's nothing in the database yet and we are trying to delete something off it, so be careful from next time. An invalidated update and upgrade could be the trouble-maker too!

    You should go to your Zen Database and check for your tables, you can do so either from going to your Database Control Panel (if your current Host supports this) or through phpMyAdmin. You have to check what is causing this error 1062 for example, if you get something like this:
    1062 Duplicate entry '1-1' for key 1
    in:
    [insert into zen_products_options_values (products_options_values_id, language_id,.............
    then you should check zen_products_options_values table and the associated fields. If your Zen Cart is fairly new or is in the production phase then you can check one of these associated fields and truncate its values. Once you are done - this error should be gone.

    In my case, I was just testing a new cart and didn't mind truncating values. PLEASE BACKUP YOUR DATABASE BEFORE YOU DO ANY MODIFICATIONS WITH YOUR TABLES/FIELDS AND ITS VALUES.

    Good Luck!

 

 

Similar Threads

  1. Can the "option name" display name be different than the actual "option name"?
    By yukionna in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 3 Dec 2013, 01:06 AM
  2. v139h DB/SQL Error when using SQL Patch for Add Pages More Info Sidebox addon
    By maperr55 in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 5 Mar 2012, 09:32 PM
  3. How can I make Option Name and Option Value inline horizontally?
    By ttmb33 in forum Customization from the Admin
    Replies: 1
    Last Post: 31 Jul 2009, 08:07 PM
  4. option name and option value not show
    By wowemall in forum Customization from the Admin
    Replies: 2
    Last Post: 3 Feb 2009, 02:36 AM
  5. Replies: 3
    Last Post: 1 Aug 2007, 04:39 AM

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