
Originally Posted by
mc12345678
So if you know what category the linked product(s) are to stay in, then I think there is even a SQL query back a few pages to address removing the product from the linked category, otherwise, the first thing to do is to make sure that the product's master_categories_id is set to a value that the product is expected to remain under, then to remove the product from the category(ies) (products_to_categories table) that it is not supposed to be related.
Not sure how familiar you are with phpmyadmin, but the following sql would identify any product that is listed in two or more categories:
Code:
SELECT ptc. * , p.master_categories_id AS mci
FROM `prefix_products_to_categories` ptc, `prefix_products` p
WHERE p.products_id = ptc.products_id
AND p.master_categories_id != ptc.categories_id
where prefix_ should be replaced with whatever DB_PREFIX is in your includes/configure.php file... If the DB_PREFIX is '' then simply remove prefix_ leaving behind all the rest...
Once more information is known about either which product(s) to keep or which category(is) are to be untouched, then the above can be modified... Suggestion is to continue using the above as a SELECT query until the result(s) identify the row(s) that are to be deleted... Then substitute everything up to the FROM statement with DELETE so that it would read DELETE FROM...
Bookmarks