Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default phpmyadmin bulk search replace

    Hi

    I need to do a bulk search and replace of a string of text which exists in hundreds of product descriptions.
    This is what I plan on using in phpmyadmin. Could someone tell me if I have this formatted correctly?

    update zen_products_description set products_description = replace(products_description,'link-to-replace.html','change-to-this-link.html');

    Also if I drop the zen_ prefix can I run this directly from admin?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: phpmyadmin bulk search replace

    Quote Originally Posted by buildingblocks View Post
    Hi

    I need to do a bulk search and replace of a string of text which exists in hundreds of product descriptions.
    This is what I plan on using in phpmyadmin. Could someone tell me if I have this formatted correctly?

    update zen_products_description set products_description = replace(products_description,'link-to-replace.html','change-to-this-link.html');

    Also if I drop the zen_ prefix can I run this directly from admin?
    Yes on all accounts. Might see a slight improvement if added
    Code:
    WHERE your_field LIKE '%link-to-replace.html%'
    Also, the link portion to replace and be replaced with may contain escape characters that need to be considered. Review of one of your subject descriptions should identify that.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: phpmyadmin bulk search replace

    thank you :-)

    should it now look like this?


    update zen_products_description set products_description = replace(products_description,'link-to-replace.html','change-to-this-link.html' WHERE products_description LIKE '%link-to-replace.html%');

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: phpmyadmin bulk search replace

    Quote Originally Posted by buildingblocks View Post
    thank you :-)

    should it now look like this?


    update zen_products_description set products_description = replace(products_description,'link-to-replace.html','change-to-this-link.html' WHERE products_description LIKE '%link-to-replace.html%');
    Close but no:
    Code:
    update zen_products_description set products_description = replace(products_description,'link-to-replace.html','change-to-this-link.html') WHERE products_description LIKE '%link-to-replace.html%';
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: phpmyadmin bulk search replace

    at the moment I am only anticipating needing to replace several links



    oldlink.html

    to

    newlink.html

    if it happens that there are any dashes - used in the link does the - need to be escaped? \-

    I am aware that ' needs to be escaped as in can\'t

  6. #6
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: phpmyadmin bulk search replace

    Quote Originally Posted by mc12345678 View Post
    Close but no:
    Code:
    update zen_products_description set products_description = replace(products_description,'link-to-replace.html','change-to-this-link.html') WHERE products_description LIKE '%link-to-replace.html%';

    ok I see what I missed....the closing parentheses was out of place

    thank you

  7. #7
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: phpmyadmin bulk search replace

    It works perfectly. Thanks for your help.

 

 

Similar Threads

  1. v151 How to replace the Filter Results By: with a search box
    By skeeterz71 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Mar 2014, 05:17 AM
  2. v151 i can pay USD60 if anyone can replace normal search with sphinx search?
    By 377704497 in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 7 Nov 2013, 03:26 PM
  3. Replace 'filter results by' with advanced search
    By stalb33 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 4 Feb 2011, 04:49 PM
  4. How to replace the head search form with Google Adsense search form?
    By lina0962 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Mar 2010, 11:33 PM
  5. how to replace the description of product in bulk?
    By handbag86 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 Jul 2009, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg