Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2004
    Posts
    24
    Plugin Contributions
    0

    Default Autoincrement product_IDs out of sync

    Trying to add products, I keep getting

    Duplicate entry 'BLAH-1' for key 1
    in:
    [insert into zen_products_description (products_name, products_description, products_url, products_id, language_id)

    etc.

    Via phpMyAdmin, I see that both my zen_products and zen_products_description tables have autoincrement set on products_id, but they're not at the same number -- the last one in zen_products is 2707, while the last one in zen_products_description is 2712.

    I'm guessing that the problem is here, but how do I fix it? Are there any other tables that are likely to be messed up, too?
    Last edited by datagnostics; 21 Jul 2009 at 10:12 PM. Reason: typo

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Autoincrement product_IDs out of sync

    1. The products_description table should NOT have an autoincrement flag set. If it does, then you're probably using an older version and haven't got the update to fix that (which happened in the upgrade to one of the newer versions).

    2. It's not uncommon for there to be additional records in the products_description table vs the products table, because the products_description table has a many-to-one relationship to the products table, with the "many" part being multiple languages used for product names/descriptions.

    3. "Duplicate entry" error messages relate to indexes, not necessarily to auto_increment activity.
    Thus, it might be that whatever record you're attempting to insert is triggering something that creates a duplicate that one of your indexes doesn't allow, on the products_description table.
    .

    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.

  3. #3
    Join Date
    Jan 2004
    Posts
    24
    Plugin Contributions
    0

    Default Re: Autoincrement product_IDs out of sync

    OK, I don't understand what I should look for.

    I've removed the autoincrement flag, but this is what I get when I try to add "test product" with description "Test product":

    Code:
    1062 Duplicate entry '2709-1' for key 1
    in:
    [insert into zen_products_description (products_name, products_description, products_url, products_id, language_id) values ('test product', 'Test product', '', '2709', '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.
    Where should I look for what, to figure out what the problem is? Thanks for your help.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Autoincrement product_IDs out of sync

    Perhaps you can answer the questions asked on the previous screen ...
    NOTE: When making a new post, be sure to include relevant information such as:

    * What version of Zen Cart are you using?
    * Has your site been upgraded? When? From what version(s)?
    * What addons have you installed? When?
    * In what ways is your site customized or different from a brand new uncustomized install?
    * If you're encountering display/layout problems, post your site URL* so it can be seen in action.
    * If you're encountering problems that could be related to your server or hosting company, include the name of your hosting company (not their URL).
    * HAVE YOU LOOKED IN THE FAQ AREA for answers to your question? (ie: a search for your error message or what you want to edit/change, etc)
    * Have you searched the FORUM for your error message or for answers to the question you're asking?
    * WHEN did the problem "start"? How does that compare with other events of your hosting company, changes you've made to your site files/addons, or your admin settings, etc?
    * If this is your first store, have you tested all aspects of transactions before going live?

    *NOTE: Search engines index this Zen Cart™ support site very quickly. Posting your URL will cause your site and your post to show up in search engines. If you want to prevent that, put spaces between each letter of the domain name in your URL.
    .

    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.

  5. #5
    Join Date
    Jan 2004
    Posts
    24
    Plugin Contributions
    0

    Default Re: Autoincrement product_IDs out of sync

    Zen Cart v1.3.7/v1.3.8
    upgraded from 1.3.7 to 1.3.8
    addons:
    categories_dressing; Column Layout Support
    template: gloss_black, but tweaked (different logo, background, button images)

    I'm not completely sure when the problem started, because I don't know if the client has been trying to put in products and failing, or not.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Autoincrement product_IDs out of sync

    If you look in phpMyAdmin, what indexes do you have on your products_description table? With each index is a list of fields included in that index. Those are important to list here too.
    .

    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.

  7. #7
    Join Date
    Jan 2004
    Posts
    24
    Plugin Contributions
    0

    Default Re: Autoincrement product_IDs out of sync

    I'm not sure I understand you. Here's the Structure of Table: zen_products_description:

    Field Type Collation Attributes Null Default
    products_id int(11) No None
    language_id int(11) No 1
    products_name varchar(64) latin1_swedish_ci No
    products_description text latin1_swedish_ci Yes NULL
    products_url varchar(255) latin1_swedish_ci Yes NULL
    products_viewed int(5) Yes 0

    I've now dropped the autoincrement, as you see.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Autoincrement product_IDs out of sync

    Okay, that's the table structure. What are the indexes on the table?
    .

    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.

  9. #9
    Join Date
    Jan 2004
    Posts
    24
    Plugin Contributions
    0

    Default Re: Autoincrement product_IDs out of sync

    Code:
    Keyname  	      Type  	Cardinality   	Field
    PRIMARY 	        PRIMARY 	223  	products_id, language_id
    idx_products_name_zen 	INDEX 	None  		products_name
    In case this isn't clear, both products_id and language_id are listed as fields under PRIMARY.
    Last edited by datagnostics; 22 Jul 2009 at 02:28 PM. Reason: layout

  10. #10
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Autoincrement product_IDs out of sync

    Okay, so those are correct.

    The error message is thus coming as a result of already having a products_description record for a product_id numbered 2709 for language 1.

    You'll have to clean up the records so that you don't have any product_id records in products_description that don't match the records in your products table.
    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Quickbook Sync
    By the_ancient in forum All Other Contributions/Addons
    Replies: 282
    Last Post: 29 Jan 2015, 09:15 PM
  2. Login Sync
    By GLjames in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 14 Sep 2011, 03:40 PM
  3. zenAdminID out of sync
    By Vladimir7 in forum Basic Configuration
    Replies: 6
    Last Post: 6 Apr 2009, 09:54 PM
  4. 2 Zen Databases Out of sync - Help
    By crazycucumber in forum General Questions
    Replies: 2
    Last Post: 7 Feb 2007, 01:07 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