07 Nov 2008

Search and Replace

Written by Brian Teeman
correcting text

This post is here because in the last 3 weeks I must have googled for the answer about 5 times.

How do you search and replace a word in a database using phpMyAdmin?

update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

So if I wanted to change every occurance of "joomla" to "Joomla!" in the articles of this site I would use the query window of phpMyAdmin and type

UPDATE jos_content SET introtext=REPLACE(introtext,'joomla','Joomla!');

blog comments powered by Disqus

About Brian Teeman

  • As a co-founder of Joomla! and OpenSourceMatters Inc I've never been known to be lacking an opinion or being too afraid to express it.

    Despite what some people might think I'm a shy and modest man who doesnt like to blow his own trumpet or boast about achievements.

    But it seems that no blog exists without an "About" page so rather than talk about what an amazingly great guy I am and list all the things I've achieved (and failed at) in life from my Cycling Proficiency Test in 1976 to winning an award for the "UK Individual Contribution to Open / Source" in 2005 here are some links.

    {...}