Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default use database IDs again?

    Is there any way to tell the database to release (for use) IDs (Product IDs and Category IDs) that have been used in the past?

    I deleted the product/category, but am not able to use that ID again. Is it lost forever or can I go into the database or somewhere to allow use of it again?

    I realize that current products or category IDs that come after the missing IDs may not allow for this, but I don't have ANY current product or category IDs after the missing IDs, so it seems that there would be a way of setting back the counter to start assigning IDs from the beginning of the list that is now unavailable. Thanks.

  2. #2
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Reset products_id and categories_id

    Dr Byte

    I am working in phpMyAdmin to try to get back the Product IDs #s and Category IDs #s that were used up when I was trying to use Easy Populate to add some records. I now have 4 categories and would like the numbering to start again at 5 if possible. Likewise with products, which are currently numbering at over 400, when it would be better if I could get numbering back to 39 or so.

    anyway, I looked at these instructions you wrote about truncating the db in phpMyAdmin, but when I look at these tables, the extraneous IDs are not there -- the db appears to have already dropped the extraneous IDs.

    But if I add a Category or Product in Zen Cart Admin, it still starts numbering at the high, inflated number and not near the number in the tables. Is there another table that 'stores' the phantom IDs and 'forces' new numbering to go over the top of them?

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: use database IDs again?

    Quote Originally Posted by finlander View Post
    Is there any way to tell the database to release (for use) IDs (Product IDs and Category IDs) that have been used in the past?

    I deleted the product/category, but am not able to use that ID again. Is it lost forever or can I go into the database or somewhere to allow use of it again?

    I realize that current products or category IDs that come after the missing IDs may not allow for this, but I don't have ANY current product or category IDs after the missing IDs, so it seems that there would be a way of setting back the counter to start assigning IDs from the beginning of the list that is now unavailable. Thanks.
    Highly dangerous

    This is only used by the code and the customer is not privy to it

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

    Default Re: Reset products_id and categories_id

    Quote Originally Posted by finlander View Post
    But if I add a Category or Product in Zen Cart Admin, it still starts numbering at the high, inflated number and not near the number in the tables. Is there another table that 'stores' the phantom IDs and 'forces' new numbering to go over the top of them?
    If you cannot live with yourself if you have gaps in your numbers and you are absolutely certain you won't fudge up your database by mucking about with it, then go change the autoincrement values on the products and categories tables to the number you want to use next. You can use phpMyAdmin to do that.

    Disclaimer: This is an ADVANCED activity. YOU SHOULD NOT BE TOUCHING THESE THINGS. USE AT OWN RISK.
    ALWAYS DO DATABASE BACKUPS **FIRST**.
    .

    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
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: use database IDs again?

    Thank you, and for the warning, also. It would be best, after all, if I only do things I am fully comfortable with, but since that's not my nature.... :)

    I went ahead last night and did a new install and brought up to snuff all customizations and mods installed, etc. Good practice!

    Thank you for the disclosing auto-increment reset .. I really did not think it would be that "simple" but I understand the danger.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 11 Mar 2011, 10:56 AM
  2. Reset prod IDs and Categories IDs
    By savchenko01 in forum General Questions
    Replies: 2
    Last Post: 31 Jan 2011, 05:21 PM
  3. Cannot login or signin a new customer again migrate my database
    By alimtlai in forum Upgrading from 1.3.x to 1.3.9
    Replies: 0
    Last Post: 15 Dec 2009, 04:34 PM

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