<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: A MySQL Class/Iterator for PHP5</title>
	<link>http://www.w3style.co.uk/a-mysql-classiterator-for-php5</link>
	<description>Chris Corbyn, WebGeek</description>
	<pubDate>Tue, 02 Dec 2008 12:46:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>

	<item>
		<title>By: &#160; links for 2008-04-22&#160;by&#160;chrispie.de - tech / fun / berlin</title>
		<link>http://www.w3style.co.uk/a-mysql-classiterator-for-php5#comment-10579</link>
		<author>&#160; links for 2008-04-22&#160;by&#160;chrispie.de - tech / fun / berlin</author>
		<pubDate>Tue, 22 Apr 2008 23:50:18 +0000</pubDate>
		<guid>http://www.w3style.co.uk/a-mysql-classiterator-for-php5#comment-10579</guid>
		<description>[...] W3 Style » Blog Archive » A MySQL Class/Iterator for PHP5 (tags: php mysql) [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] W3 Style » Blog Archive » A MySQL Class/Iterator for PHP5 (tags: php mysql) [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jcart</title>
		<link>http://www.w3style.co.uk/a-mysql-classiterator-for-php5#comment-258</link>
		<author>Jcart</author>
		<pubDate>Wed, 13 Jun 2007 07:58:24 +0000</pubDate>
		<guid>http://www.w3style.co.uk/a-mysql-classiterator-for-php5#comment-258</guid>
		<description>A couple comments about your query:
   1. For consistancy, use the connection resource on the mysql_query() call
   2. There are other types of queries that we do not want a result set, I've whipped something up to demonstrate briefly
   3. Incase we do not want a result set, I thought it would be a good idea to return a boolean if the query was succesful or not

Untested
&lt;code&gt;public function query($query)
{
	$result = @mysql_query($query, $this-&#62;conn);
	$tokens = explode(' ', $query);
	if (count($tokens) &#62; 0) 
	{
		if (!in_array(trim($token), array('update', 'delete', 'insert')) {
			return new DB_Result($result, $this-&#62;conn, $insert);
		}
	}
	
	return is_resource($result);
}&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>A couple comments about your query:<br />
   1. For consistancy, use the connection resource on the mysql_query() call<br />
   2. There are other types of queries that we do not want a result set, I&#8217;ve whipped something up to demonstrate briefly<br />
   3. Incase we do not want a result set, I thought it would be a good idea to return a boolean if the query was succesful or not</p>
<p>Untested</p>
<div class="codesnip-container" >public function query($query)<br />
{<br />
	$result = @mysql_query($query, $this-&gt;conn);<br />
	$tokens = explode(&#8217; &#8216;, $query);<br />
	if (count($tokens) &gt; 0)<br />
	{<br />
		if (!in_array(trim($token), array(&#8217;update&#8217;, &#8216;delete&#8217;, &#8216;insert&#8217;)) {<br />
			return new DB_Result($result, $this-&gt;conn, $insert);<br />
		}<br />
	}</p>
<p>	return is_resource($result);<br />
}</p></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthijs</title>
		<link>http://www.w3style.co.uk/a-mysql-classiterator-for-php5#comment-6</link>
		<author>Matthijs</author>
		<pubDate>Sun, 13 Aug 2006 13:47:58 +0000</pubDate>
		<guid>http://www.w3style.co.uk/a-mysql-classiterator-for-php5#comment-6</guid>
		<description>Looks good Chris. Have seen examples of this separation of db and dbresult elsewere, think in the sitepoint book of Harry Fuechs. Seems a logical way to do it. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Looks good Chris. Have seen examples of this separation of db and dbresult elsewere, think in the sitepoint book of Harry Fuechs. Seems a logical way to do it. Thanks for sharing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
