Jump to content

How To Disable Products by Manufacturer in PHPMyAdmin?


Dave Angel

Recommended Posts

Hi,

 

I would like to know what sql I can run that will disable all products from a certain manufacturer, for example;

UPDATE `ps_product` SET `active` = 0 WHERE `id_manufacturer` = 118

This obviously sets all products from manufacturer 118 to active =0 or turns them off, but it doesn't.

 

I have also found that there is an active=1 or 0 in the table ps_product_shop.

 

The problem is ps_product_shop does not have the id_manufacturer column only the id_product column is in both tables.

 

So, how do I join the script together to turn the active=0 in both tables?

UPDATE `ps_product` SET `active` = 0 WHERE `id_manufacturer` = 118
UPDATE `ps_product_shop` SET `active` = 0 WHERE `id_product` = (id_product from ps_product where id_manufacturer=118)

My sql (no pun intended) is not good enough to be able to work on two tables at the same time so any help would be immense!!

 

This is for PS v1.6.0.11

 

Many thanks,

 

Rob.

Edited by Dave Angel (see edit history)
Link to comment
Share on other sites

The easiest way to do this with my free Triple Edit script.

 

My next preference would be using a PHP script. That way you can avoid the complexity in MySql. An additional benefit is that in PHP you can easily insert debug code what makes the chances on error smaller. 

 

I am not sure about the nested MySql code. At least you need to start the part between brackets with "select". It may also be that you need to replace the "=" before the brackets with "IN" but I am not sure about that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...