Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Product Status - Inactive


Recommended Posts

the only way that I have really found is to get all of the products_model numbers and put them in a text file, then loop through the text file and query the database accordingly for each.


cat $INFILE |
while read PRODUCTS_MODEL;
	   mysql -uusername -ppassword database_name -e "update products set products_status = '0' where products_model = '$PRODUCTS_MODEL'"


Something along those lines should work, I think. Do some debug and backup your database before you try any of it. To debug, I would suggest creating a small text file with two products in it and running that through the script. Verify that the statuses of those two products change as you would expect (0 or 1). If it works, then you should be in good shape.


Good luck!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...