SCH_001 Posted June 22, 2018 Share Posted June 22, 2018 Hi all, I have the need to bulk update all the weights in a category / sub category Is there a command I can run in phpmyadmin to update the weight of all items in say category Top » Catalog » Buggies / Trucks » 1/10th Brushless to 3.0 Link to comment Share on other sites More sharing options...
MrPhil Posted June 22, 2018 Share Posted June 22, 2018 The toughest part will be coming up with the right WHERE clause to deal with just the desired category's entries. Blending category information with product data may require a few JOINs in the clause. After that, something like SET weight='3.0' should be trivial. You can play around in phpMyAdmin and see if you can come up with a SELECT statement just for the items you want, and then change it to an UPDATE statement with the SET. Depending on whether this is going to be a frequent operation or is a one-off, you might find it easier to gather the information playing in phpMyAdmin and manually build an SQL file with a bunch of updates, and import it into your database. It would probably be a good idea to back up your database before doing any updates/writing/imports to the database. Link to comment Share on other sites More sharing options...
burt Posted June 22, 2018 Share Posted June 22, 2018 Google is your friend... Link to comment Share on other sites More sharing options...
SCH_001 Posted June 24, 2018 Author Share Posted June 24, 2018 Hi Burt, thank you for this snippet. How do I get the categories_id number for categories and sub categories I have done some goggling but not found the answer Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.