
MYSQL
Updating weights on products in prestashop on mass
There are occasions where you might need to update a group of products weight. Recently I had a whole bunch of products that were in correctly set as 2KG when they should have been set to 0.2KG (200 grams). I started off manually changing them and then thought..no thanks this will take all day.
Luckily mySQL is your friend!
Using this query I was able to update all products weight within a certain category from 2KG to 0.2KG.
I knew the category I wanted to update was category 3 so I ran the following query:
UPDATE ps_product
SET weight = 0.2
WHERE weight = 2
Quick MySQL Tip
This is a tip for me as much as anyone since I have a mental block about it for some reason...
Update Column values to null
If i want to remove all the data in a mysql column. I can do it by setting the values to null like so...
UPDATE tablename Set `column_name` = NullInstall Prestashop on a local host WAMP server
Check you have a working WAMP installation
WAMP stands for Windows, Apache, mySQL, PHP. It refers to the key components used to run a lot of dynamic websites on a Windows machine. It often used for developing web applications on your local machine before putting it live on your server. You can get prebuilt installation routines that make installing a WAMP a real breeze. The one I am using for this article can be found here www.wampserver.com.
Backing Up a Remote MYSQL Database with a Linux based QNAP 109 Network Attached Storage
Introduction
Using a QNAP linux NAS you can backup MYSQL databases on remote servers. This article shows you how to write a script to do this. This script can then be run at set intervals using the cron scheduler to ensure your mysql data server is backed up safely.
This guide assumes your server is running the SSHD and allows you to run remote commands. For example a VPS server is the perfect example of this.