tom198c Posted December 19, 2012 Share Posted December 19, 2012 Hello, I can replace prices OK with the following command but I only want to replace the prices if the products_folder = /john/thomas UPDATE products SET products_price = REPLACE(products_price, "39", "29"); WHERE product_folder = /john/thomas how do I do this correctly? the above show an error, #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE products_folder. I think I am almost there... thanks Link to comment Share on other sites More sharing options...
burt Posted December 19, 2012 Share Posted December 19, 2012 UPDATE products SET products_price = REPLACE(products_price, "39", "29") WHERE product_folder = '/john/thomas' is more like it. Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted December 19, 2012 Share Posted December 19, 2012 and make sure you use the correct column name ... you have been using product_folder and products_folder (so with an extra s) in your post! use whichever matches your database ... :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.