what is the "best/safest" way to create a category with a specific id number?
or edit an id number say 311 change to 88?
thanks.
what is the "best/safest" way to create a category with a specific id number?
or edit an id number say 311 change to 88?
thanks.
The category id is auto-generated by the database, and incremented to one more than the last created category id. It would be dangerous to alter that; if you were to alter it to a no-longer-used number, there are other tables where you would have to make the same alteration.
thanks gjh42.
what happened was i had a category 88 but it didn't have any subcats. i need to add subcats. so i created a new cat with subcats 311 and put everything in there. but i accidentally deleted cat 88. :-(
so now i want to rename 311 to 88...
or create a new cat 88 and copy everything from 311 into it.
the only reason i am considering doing this is because i have links indexed to the cat 88...
any advice?
thanks.
This requires someone like Ajeh with intimate knowledge of the database tables, who can tell you all the tables that need to be coordinated for this task (and the SQL to do it).
Backup your database before doing this ...
Then run the following SQL commands to rebuild the tables so that all references to Categories to change categories_id 311 to 88 ...
UPDATE categories SET categories_id = 88 WHERE categories_id = 311;UPDATE categories_description SET categories_id = 88 WHERE categories_id = 311;UPDATE products SET master_categories_id = 88 WHERE master_categories_id = 311;UPDATE products_to_categories SET categories_id = 88 WHERE categories_id = 311;
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!
you know you're awesome! as always, thanks ajeh!!!
![]()
you know you're awesome! as always, thanks ajeh!!!
![]()