<?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 update	</title>
	<atom:link href="/2006/06/15/mysql-update/feed/" rel="self" type="application/rss+xml" />
	<link>/2006/06/15/mysql-update/</link>
	<description>my thoughts and ideas</description>
	<lastBuildDate>Wed, 15 Nov 2006 10:02:07 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.2</generator>
	<item>
		<title>
		By: Rich		</title>
		<link>/2006/06/15/mysql-update/comment-page-1/#comment-3354</link>

		<dc:creator><![CDATA[Rich]]></dc:creator>
		<pubDate>Thu, 31 Aug 2006 19:45:32 +0000</pubDate>
		<guid isPermaLink="false">http://cms.elfden.co.uk/2006/06/15/mysql-update/#comment-3354</guid>

					<description><![CDATA[Simple idea, sounds good, must use at some point!

Going back thorugh things i have written to try and optimise is not something I am good at - but at some point I really need to.

Hopefully I can utilise this then, many many thanks for the tip!]]></description>
			<content:encoded><![CDATA[<p>Simple idea, sounds good, must use at some point!</p>
<p>Going back thorugh things i have written to try and optimise is not something I am good at &#8211; but at some point I really need to.</p>
<p>Hopefully I can utilise this then, many many thanks for the tip!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: John		</title>
		<link>/2006/06/15/mysql-update/comment-page-1/#comment-3348</link>

		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Thu, 31 Aug 2006 09:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://cms.elfden.co.uk/2006/06/15/mysql-update/#comment-3348</guid>

					<description><![CDATA[There IS a way - but you&#039;re right, not by doing a straight update.

Instead you need to create an alternative table and fill with the desired values, and then use an update query to applay the changes. You can do this with no more than 3 queries like this:

CREATE TEMPORARY TABLE blah (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY 
`keys` INT NOT NULL ,
`text` VARCHAR( 50 ) NOT NULL ,
); #Create a temporary table with the id and field you wish to change

INSERT INTO BLAH (keys,text) VALUES (3,&#039;FIRE&#039;),(5,&#039;BALLS&#039;); #insert your proposed changes into the temporary table

UPDATE mywords SET mywords.text = blah.text WHERE mywords.index = blah.index; #now use the new table to apply the changes with one update.

I&#039;m using mySQL 5, so I&#039;m not sure about how mySQL 4 .x deals with temporary tables, but there it is. I hope it works.]]></description>
			<content:encoded><![CDATA[<p>There IS a way &#8211; but you&#8217;re right, not by doing a straight update.</p>
<p>Instead you need to create an alternative table and fill with the desired values, and then use an update query to applay the changes. You can do this with no more than 3 queries like this:</p>
<p>CREATE TEMPORARY TABLE blah (<br />
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY<br />
`keys` INT NOT NULL ,<br />
`text` VARCHAR( 50 ) NOT NULL ,<br />
); #Create a temporary table with the id and field you wish to change</p>
<p>INSERT INTO BLAH (keys,text) VALUES (3,&#8217;FIRE&#8217;),(5,&#8217;BALLS&#8217;); #insert your proposed changes into the temporary table</p>
<p>UPDATE mywords SET mywords.text = blah.text WHERE mywords.index = blah.index; #now use the new table to apply the changes with one update.</p>
<p>I&#8217;m using mySQL 5, so I&#8217;m not sure about how mySQL 4 .x deals with temporary tables, but there it is. I hope it works.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
