Forums / General Questions / product id - number too high

product id - number too high

Locked

Started by makenoiz on 15 Nov 2009, 8:00 AM · Views: 747

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
15 Nov 2009, 8:00 AM
#1
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

product id - number too high

I was testing some products and accidentally placed 9999 in the DB for a product. Now, even though I have deleted all subsequent products my product ids continue on upward now past 10027. I can see where this is cached or stored. Im still just testing this store and I want to get my numbers back down where they were in the 2000's. How can I reset this?

Thank you

22 stores and counting! Ive been zenned.

15 Nov 2009, 7:55 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product id - number too high

Backup your database ...

Next, browse your products table and sort in order by products_id ...

Check the last value ...

If it were 232, and you want to reset the next AUTO_INCREMENT to be 233, you can use:

ALTER TABLE products AUTO_INCREMENT = 233;
```:

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!]
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!

15 Nov 2009, 7:55 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product id - number too high

NOTE: you cannot lower this value below the highest value in your database table ...

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!]
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!

15 Nov 2009, 10:47 PM
#4
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: product id - number too high

You rock.
Thanks.

22 stores and counting! Ive been zenned.

15 Nov 2009, 11:24 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: product id - number too high

NOTE TO FUTURE READERS OF THIS DISCUSSION: merely changing the AUTO_INCREMENT setting is not enough. If you've added ANY products after changing the number in the database, then SEVERAL OTHER TABLES will also contain data related to those products. You'll need to use your Zen Cart admin area to delete ALL those additional products BEFORE you change the auto_increment value in the products table ... otherwise you'll have seriously corrupted data in all future product records, thus resulting in product/category/description mismatches and an inability for sales/specials and searches to work correctly.

In short, one should never mess with the raw data in the database without first having a solid understanding of what affects what.
And make REGULAR FREQUENT database backups!

.
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.