
Originally Posted by
Paul69
The master ID is the only one ID right? It is not possible to have multiple ID's linked to a single product right? Maybe I just don't understand but if the subcategories are mapped with the "categories" table and the product relationship key is the ID through the "product_to_categories" then there is only one master ID.
Shoot... Ok I think I see something now, the default in the data base is set to "0" so if there is no parent then "0" is the flag. If it is not "0" then it is a sub category. How about
UPDATE categories
SET categories_id='YOU VALUE' WHERE parent_id ="0"
If you don't have a "0" under parent_id you may have a biffer problem.
parent_id is not always 0 .... in my understanding parent_id reflects the parent ID of the subcategory for instance if I do a query:
Code:
SELECT *
FROM `categories`
WHERE parent_id =421
I get all the subcats whose parent ID is 421.
422 421 0 2009-04-29 07:39:13 2009-11-23 23:34:19 1 1
Edit Delete 456 421 0 2009-04-29 07:39:14 2009-11-23 23:28:29 1 1
Edit Delete 473 421 0 2009-04-29 07:39:18 2009-11-23 23:34:32 1 1
Edit Delete 486 421 0 2009-04-29 07:39:18 2009-11-23 23:26:47 1 1
Edit Delete 492 421 0 2009-04-29 07:39:18 2009-11-23 23:28:17 1 1
Edit Delete 498 421 0 2009-04-29 07:39:18 2009-11-23 23:33:08 1 1
Edit Delete 537 421 0 2009-04-29 07:39:26 2009-11-23 23:28:46 1 1
Edit Delete 564 421 0 2009-04-29 07:39:26 2009-11-23 23:29:02 1 1
Edit Delete 615 421 0 2009-04-29 07:39:38 2009-11-23 23:34:06 1 1
Edit Delete 707 421 0 2009-04-29 07:39:57 2009-11-23 23:27:35 1 1
Edit Delete 722 421 0 2009-04-29 07:40:06 2009-11-23 23:28:04 1 1
Edit Delete 867 421 0 2009-04-29 07:41:47 2009-11-23 23:29:20 1 1
Edit Delete 869 421 0 2009-04-29 07:41:47 2009-11-23 23:34:44 1 1
Edit Delete 954 421 0 2009-04-29 07:43:53 2009-11-23 23:27:06 1 1
Edit Delete 976 421 0 2009-04-29 07:44:40 2009-11-23 23:33:24 1 1
Edit Delete 1484 421 0 2009-12-07 07:02:39 2009-12-07 07:02:39 1 1
Edit Delete 1523 421 0 2009-12-07 07:05:37 2009-12-07 07:05:37 1 1
Edit Delete 1856 421 0 2010-04-11 07:14:30 2010-04-11 07:14:30 1
but I also get the duplicated categories ... that's what I want to eliminate but also move the subcats under the same folder, and delete the other one, in my case I need to FIX 1523 and move all their subcategories under 615, then delete 1523 ... (there are no linked products under 1523), and so on with the other duplicates ...