<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FluxBB.org Forums - Database update question]]></title>
	<link rel="self" href="http://fluxbb.org/forums/feed/atom/topic/3050/"/>
	<updated>2009-06-29T15:06:45Z</updated>
	<generator>FluxBB</generator>
	<id>http://fluxbb.org/forums/topic/3050/database-update-question/</id>
		<entry>
			<title type="html"><![CDATA[Re: Database update question]]></title>
			<link rel="alternate" href="http://fluxbb.org/forums/post/24002/#p24002"/>
			<content type="html"><![CDATA[Cheers chaps. :) It's only a straight forward update for a forum id if the topic reference id exists, so whether it exists isn't the important part, merely the changing of it if it does. Didn't want to be using the second method if had any known caveats though. :D

Thanks again. :)]]></content>
			<author>
				<name><![CDATA[MattF]]></name>
				<uri>http://fluxbb.org/forums/user/14/</uri>
			</author>
			<updated>2009-06-29T15:06:45Z</updated>
			<id>http://fluxbb.org/forums/post/24002/#p24002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Database update question]]></title>
			<link rel="alternate" href="http://fluxbb.org/forums/post/23991/#p23991"/>
			<content type="html"><![CDATA[Well, the general consesus is usually 'let the database handle it', especially for constraints etc.
I'd go for the second case, you can always see if any rows were affected, so that isn't a reason to not do it this way either.]]></content>
			<author>
				<name><![CDATA[elbekko]]></name>
				<uri>http://fluxbb.org/forums/user/6/</uri>
			</author>
			<updated>2009-06-29T11:58:19Z</updated>
			<id>http://fluxbb.org/forums/post/23991/#p23991</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Database update question]]></title>
			<link rel="alternate" href="http://fluxbb.org/forums/post/23988/#p23988"/>
			<content type="html"><![CDATA[Depends really.  There are, potentially, situations where you would want to only update things that have changed and other cases where simply updating everything might be a better choice.  I don't think you can say that either method is THE method to use.]]></content>
			<author>
				<name><![CDATA[Dave]]></name>
				<uri>http://fluxbb.org/forums/user/54/</uri>
			</author>
			<updated>2009-06-29T11:47:36Z</updated>
			<id>http://fluxbb.org/forums/post/23988/#p23988</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Database update question]]></title>
			<link rel="alternate" href="http://fluxbb.org/forums/post/23985/#p23985"/>
			<content type="html"><![CDATA[Just wanting to double check on this one. :)

In theory, is best to see if an entry matches certain criteria in a specific table before applying an UPDATE to change the value, or just do the UPDATE incase any rows match the criteria, without checking first?

I assume the second method, as there's one less query to the DB?]]></content>
			<author>
				<name><![CDATA[MattF]]></name>
				<uri>http://fluxbb.org/forums/user/14/</uri>
			</author>
			<updated>2009-06-29T10:07:29Z</updated>
			<id>http://fluxbb.org/forums/post/23985/#p23985</id>
		</entry>
</feed>
