<?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: MySQL Search and Replace</title> <atom:link href="http://blog.urbanmainframe.com/2008/07/mysql-search-replace/feed/" rel="self" type="application/rss+xml" /><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/</link> <description>an oasis for idle minds</description> <lastBuildDate>Thu, 11 Mar 2010 16:57:54 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Jonathan Hollin</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-612</link> <dc:creator>Jonathan Hollin</dc:creator> <pubDate>Mon, 16 Nov 2009 10:21:50 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-612</guid> <description>@Rims: Well surely, if you only have one instance of a word to replace, then your best option would be to edit that instance using whatever tool you normally use for manipulating your content?The search-and-replace mechanism discussed here is designed for making bulk changes.</description> <content:encoded><![CDATA[<p>@Rims: Well surely, if you only have one instance of a word to replace, then your best option would be to edit that instance using whatever tool you normally use for manipulating your content?</p><p>The search-and-replace mechanism discussed here is designed for making bulk changes.</p> ]]></content:encoded> </item> <item><title>By: Rims</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-611</link> <dc:creator>Rims</dc:creator> <pubDate>Mon, 16 Nov 2009 09:35:36 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-611</guid> <description>This is great but how do I replace only one instance of the word instead of every?</description> <content:encoded><![CDATA[<p>This is great but how do I replace only one instance of the word instead of every?</p> ]]></content:encoded> </item> <item><title>By: Jonathan Hollin</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-592</link> <dc:creator>Jonathan Hollin</dc:creator> <pubDate>Fri, 30 Oct 2009 04:20:46 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-592</guid> <description>That&#039;s really cool Dave. Thank you for letting me know it worked for you. It&#039;s great to hear these little success stories.All the best.</description> <content:encoded><![CDATA[<p>That’s really cool Dave. Thank you for letting me know it worked for you. It’s great to hear these little success stories.</p><p>All the best.</p> ]]></content:encoded> </item> <item><title>By: Dave Onex</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-590</link> <dc:creator>Dave Onex</dc:creator> <pubDate>Fri, 30 Oct 2009 01:26:08 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-590</guid> <description>Thanks very much for posting up this simple SQL Query!I have a discussion forum with about 40,000 posts - most of them containing lots of emoticons.The problem is that I changed my site&#039;s domain name at one point and so all of those emoticons now reference a domain name that no longer exists. That resulted in TONS of 404 errors and gaps in the posts that looked rather ugly.So, I needed to replace every instance of oldname.com with newname.com in the posts field without wrecking the posts themselves (that would be a disaster).Your script enabled me to do that with ease and it updated 6,486 rows with the correct domain name :-)I knew it could easily be done with SQL but I didn&#039;t know how until I came across your site - thank you!</description> <content:encoded><![CDATA[<p>Thanks very much for posting up this simple <acronym title="Structured Query Language">SQL</acronym> Query!</p><p>I have a discussion forum with about 40,000 posts - most of them containing lots of emoticons.</p><p>The problem is that I changed my site’s domain name at one point and so all of those emoticons now reference a domain name that no longer exists. That resulted in TONS of 404 errors and gaps in the posts that looked rather ugly.</p><p>So, I needed to replace every instance of oldname.com with newname.com in the posts field without wrecking the posts themselves (that would be a disaster).</p><p>Your script enabled me to do that with ease and it updated 6,486 rows with the correct domain name <img src='http://blog.urbanmainframe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><p>I knew it could easily be done with <acronym title="Structured Query Language">SQL</acronym> but I didn’t know how until I came across your site - thank you!</p> ]]></content:encoded> </item> <item><title>By: Jonathan Hollin</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-504</link> <dc:creator>Jonathan Hollin</dc:creator> <pubDate>Fri, 09 Oct 2009 15:10:22 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-504</guid> <description>Yes. I think this should work: update posts set content = replace(content,&#039;replace this string&#039;,&#039;with this one&#039;);Or is that not what you meant?</description> <content:encoded><![CDATA[<p>Yes. I think this should work: update posts set content = replace(content,‘replace this string’,‘with this one’);</p><p>Or is that not what you meant?</p> ]]></content:encoded> </item> <item><title>By: Troy Hall</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-503</link> <dc:creator>Troy Hall</dc:creator> <pubDate>Fri, 09 Oct 2009 14:55:12 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-503</guid> <description>Anyway to replace one string with another in the same way you did that single word?</description> <content:encoded><![CDATA[<p>Anyway to replace one string with another in the same way you did that single word?</p> ]]></content:encoded> </item> <item><title>By: Jonathan Hollin</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-470</link> <dc:creator>Jonathan Hollin</dc:creator> <pubDate>Sat, 12 Sep 2009 13:50:58 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-470</guid> <description>@sami: I can&#039;t say for certain without testing this, but IIRC this search-and-replace only does whole words.@sandrar: Thank you. :-)</description> <content:encoded><![CDATA[<p>@sami: I can’t say for certain without testing this, but <acronym title="If I remember correctly">IIRC</acronym> this search-and-replace only does whole words.</p><p>@sandrar: Thank you. <img src='http://blog.urbanmainframe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: sandrar</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-464</link> <dc:creator>sandrar</dc:creator> <pubDate>Thu, 10 Sep 2009 13:44:23 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-464</guid> <description>Hi! I was surfing and found your blog post... nice! I love your blog.  :) Cheers! Sandra. R.</description> <content:encoded><![CDATA[<p>Hi! I was surfing and found your blog post… nice! I love your blog. <img src='http://blog.urbanmainframe.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Cheers! Sandra. R.</p> ]]></content:encoded> </item> <item><title>By: sami</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-463</link> <dc:creator>sami</dc:creator> <pubDate>Thu, 10 Sep 2009 07:58:26 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-463</guid> <description>is there a way of replacing the exact words? For example: i have the word &quot;Jo&quot; `name`table and i want to replace it with &quot;hello&quot;. But `name`table i also have the word &quot;John&quot;. I haven&#039;t tried it but i think this will result in replacing &quot;Jo&quot; with &quot;hello&quot;, but will also replace &quot;John&quot; with &quot;hellohn&quot;.</description> <content:encoded><![CDATA[<p>is there a way of replacing the exact words?<br /> For example: i have the word “Jo” ‘name‘table and i want to replace it with “hello”. But ‘name‘table i also have the word “John”. I haven’t tried it but i think this will result in replacing “Jo” with “hello”, but will also replace “John” with “hellohn”.</p> ]]></content:encoded> </item> <item><title>By: Jonathan Hollin</title><link>http://blog.urbanmainframe.com/2008/07/mysql-search-replace/#comment-449</link> <dc:creator>Jonathan Hollin</dc:creator> <pubDate>Fri, 04 Sep 2009 22:57:31 +0000</pubDate> <guid isPermaLink="false">http://blog.urbanmainframe.com/?p=83#comment-449</guid> <description>@irms: Nice contribution to the thread. Thank you.</description> <content:encoded><![CDATA[<p>@irms: Nice contribution to the thread. Thank you.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Served from: acmkokecqs.gs01.gridserver.com @ 2010-03-14 03:07:30 by W3 Total Cache -->