I have been reading some discussions on find/replace using SQL and want to be sure I understand what I'm doing before implementing. I've backed up the database per this tutorial, https://www.zen-cart.com/tutorials/i...hp?article=103, and copied website to FTP backup location.
I have unfortunately copy/pasted numerous urls into product listings (using the Bookshelf template) and discovered I failed to remove the http:// instead of just starting with www. I was correcting them one at a time but just learned how to go into the database side using phpMyAdmin, and though I am a ZenCart newbie, seeing the database behind the scenes really was exciting, because I am used to working with databases/data-tables and editing data directly in the tables, writing visual basic code to automate the databases and being able to export to Excel, import, etc. Very little MySQL experience, mostly Microsoft Access, Oracle, using SQL and Visual Basic in both, so seeing the database side really triggered a desire to learn more about how to get into the ZenCart tables and work with them better.
This discussion http://www.zen-cart.com/forum/showthread.php?t=124425 sounds like what I'm needing to do, but want to make sure I have an understanding of how to find/replace in the exact field that's needed. For example, in the linked discussion, here is what seemed to be the solution:
UPDATE products_description SET products_description = REPLACE(products_description, 'hematite', 'magnatite');
It appears the field name I need to find/replace in mine is products_url. How would I modify above and what is the difference between Tools/Install SQL Patches and selecting the SQL tab within the database where it seems you can select the field name from dropdown.
My guess would be something like this, but would appreciate a double check if I'm on the right track and how to implement.
UPDATE products_url SET products_url = REPLACE(products_url, 'http://www', 'www');
Any tips to help in understanding this side of things in general, and if I'm on the right track with the find/replace problem would be very appreciated, thank you so much.
Version 1.3.9


Reply With Quote
