<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Interwebtranet &#187; MySQL</title>
	<atom:link href="http://interwebtranet.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://interwebtranet.com</link>
	<description>The Web &#38; Whatnot</description>
	<lastBuildDate>Tue, 30 Aug 2011 04:04:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>MySQL Search &amp; Replace</title>
		<link>http://interwebtranet.com/mysql-search-replace/</link>
		<comments>http://interwebtranet.com/mysql-search-replace/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 22:09:34 +0000</pubDate>
		<dc:creator>Mr. Matthews</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://interwebtranet.com/?p=36</guid>
		<description><![CDATA[It seems like every six months or so I need to do some site wide replacing (not often enough to commit this tip to memory it seems). If the site was built as flat HTML pages, I’ll use the find/replace feature in whatever editor I am using at the time. These days—more often than not—the [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like every six months or so I need to do some site wide replacing (not often enough to commit this tip to memory it seems). If the site was built as flat HTML pages, I’ll use the find/replace feature in whatever editor I am using at the time. These days—more often than not—the actual site content is somewhere in a <a href="http://www.mysql.com/">MySQL</a> database. When that is the case, this one-liner comes in handy.</p>
<pre class="sql" name="code">update table set field = replace(field,'find_this','replace_with_this');</pre>
<p>As with any database change, you should first back up your database, or at the very least duplicate the table (with the content—of course).</p>
<p>Let’s say you wanted to change the words <em>“Web site”</em> to the more commonly used <em>“website”</em> in all of your site content. If the table holding the content is named <strong>tbl_content</strong> and the field was named <strong>page_content</strong>, then your MySQL command would look like this:</p>
<pre class="sql" name="code">update table_content set page_content = replace(page_content,'Web site','website');</pre>
]]></content:encoded>
			<wfw:commentRss>http://interwebtranet.com/mysql-search-replace/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

