<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Find and replace text in mysql</title>
	<atom:link href="http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/</link>
	<description>Web Development, Web Design, Web Applications, Web 2.0, AJAX, WordPress Themes, Search Engine Optimisation, Latest Technologies and more..</description>
	<lastBuildDate>Tue, 20 Mar 2012 09:48:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: walmley web design</title>
		<link>http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/comment-page-1/#comment-151840</link>
		<dc:creator>walmley web design</dc:creator>
		<pubDate>Tue, 01 Feb 2011 13:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/#comment-151840</guid>
		<description>I recently wanted to replace a string within MySQL on the fly, but the field could contain 2 items. So I wrapped a REPLACE() within a REPLACE(), such as:

REPLACE(REPLACE(field_name, “what we are looking for”, “replace first instance”), “something else we are looking for”, “replace second instance”)

This is the syntax I used to detect a boolean value:

REPLACE(REPLACE(field, 1, “Yes”), 0, “No”)

Hope this helps!</description>
		<content:encoded><![CDATA[<p>I recently wanted to replace a string within MySQL on the fly, but the field could contain 2 items. So I wrapped a REPLACE() within a REPLACE(), such as:</p>
<p>REPLACE(REPLACE(field_name, “what we are looking for”, “replace first instance”), “something else we are looking for”, “replace second instance”)</p>
<p>This is the syntax I used to detect a boolean value:</p>
<p>REPLACE(REPLACE(field, 1, “Yes”), 0, “No”)</p>
<p>Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MJ7</title>
		<link>http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/comment-page-1/#comment-111136</link>
		<dc:creator>MJ7</dc:creator>
		<pubDate>Wed, 09 Dec 2009 12:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/#comment-111136</guid>
		<description>Great little function - have expanded it a little to find and replace across a whole database - http://www.mjdigital.co.uk/blog/search-and-replace-text-in-whole-mysql-database/

Perfect for moving a WordPress blog from a development server to a live server and changing the domain name</description>
		<content:encoded><![CDATA[<p>Great little function &#8211; have expanded it a little to find and replace across a whole database &#8211; <a href="http://www.mjdigital.co.uk/blog/search-and-replace-text-in-whole-mysql-database/" rel="nofollow">http://www.mjdigital.co.uk/blog/search-and-replace-text-in-whole-mysql-database/</a></p>
<p>Perfect for moving a WordPress blog from a development server to a live server and changing the domain name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benxamin</title>
		<link>http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/comment-page-1/#comment-82071</link>
		<dc:creator>Benxamin</dc:creator>
		<pubDate>Wed, 08 Apr 2009 21:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/#comment-82071</guid>
		<description>Oh HELL YES. Greatly appreciated.

I was pushing a WordPress site from development server to production server, and all the functions that called the &#039;guid&#039; meta data from the page array were pointing back at the dev server. 

This beats updating per line. 

UPDATE wp_posts SET guid = REPLACE(guid, &#039;dev.server.com&#039;, &#039;prod.server.com&#039;);

Like a charm. Thanks again!</description>
		<content:encoded><![CDATA[<p>Oh HELL YES. Greatly appreciated.</p>
<p>I was pushing a WordPress site from development server to production server, and all the functions that called the &#8216;guid&#8217; meta data from the page array were pointing back at the dev server. </p>
<p>This beats updating per line. </p>
<p>UPDATE wp_posts SET guid = REPLACE(guid, &#8216;dev.server.com&#8217;, &#8216;prod.server.com&#8217;);</p>
<p>Like a charm. Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/comment-page-1/#comment-81820</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Tue, 07 Apr 2009 16:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://eisabainyo.net/weblog/2006/05/26/find-and-replace-text-in-mysql/#comment-81820</guid>
		<description>Just what I needed thank you</description>
		<content:encoded><![CDATA[<p>Just what I needed thank you</p>
]]></content:encoded>
	</item>
</channel>
</rss>

