<?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: Fast and easy PHP MySQL Class</title>
	<atom:link href="http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/</link>
	<description>&#34;mbe - web developers&#34; is an amazing team of web developers based in Bucharest, Romania. We develop simple and complex websites emphasizing on user experience and quality.</description>
	<lastBuildDate>Sun, 13 May 2012 19:07:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Joe</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-8252</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Sun, 13 May 2012 19:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-8252</guid>
		<description>Never mind. I took a deeper look at the class file and figured it out ;)</description>
		<content:encoded><![CDATA[<p>Never mind. I took a deeper look at the class file and figured it out <img src='http://mbe.ro/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-8251</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Sun, 13 May 2012 19:02:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-8251</guid>
		<description>I noticed that in any of your examples there is no order by/group by clause. Is there any reason you left support for that out of the class?</description>
		<content:encoded><![CDATA[<p>I noticed that in any of your examples there is no order by/group by clause. Is there any reason you left support for that out of the class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al3xP</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-7937</link>
		<dc:creator>Al3xP</dc:creator>
		<pubDate>Tue, 24 Apr 2012 20:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-7937</guid>
		<description>Nice Work, Thank you so much. This class it&#039;s really helpfull and saves a lot of time. For those who wants to use the statement &quot;group by&quot; I added a single line for making this possible in select function:
function select($options) {
		$default = array (
			&#039;table&#039; =&gt; &#039;&#039;,
			&#039;fields&#039; =&gt; &#039;*&#039;,
			&#039;condition&#039; =&gt; &#039;1&#039;,
			&#039;order&#039; =&gt; &#039;1&#039;,
			&#039;limit&#039; =&gt; 100000,
			&#039;groupby&#039; =&gt;&#039;&#039;
		);
		$options = array_merge($default,$options);
		//modificacion group by
		if($options[&#039;groupby&#039;]==&#039;&#039;)
			$sql = &quot;SELECT {$options[&#039;fields&#039;]} FROM {$options[&#039;table&#039;]} WHERE {$options[&#039;condition&#039;]} ORDER BY {$options[&#039;order&#039;]} LIMIT {$options[&#039;limit&#039;]}&quot;;
		else
			$sql = &quot;SELECT {$options[&#039;fields&#039;]} FROM {$options[&#039;table&#039;]} WHERE {$options[&#039;condition&#039;]} GROUP BY {$options[&#039;groupby&#039;]} ORDER BY {$options[&#039;order&#039;]} LIMIT {$options[&#039;limit&#039;]}&quot;;
		return $this-&gt;query($sql);</description>
		<content:encoded><![CDATA[<p>Nice Work, Thank you so much. This class it&#8217;s really helpfull and saves a lot of time. For those who wants to use the statement &quot;group by&quot; I added a single line for making this possible in select function:</p>
<p>function select($options) {<br />
		$default = array (<br />
			&#8216;table&#8217; =&gt; &#8221;,<br />
			&#8216;fields&#8217; =&gt; &#8216;*&#8217;,<br />
			&#8216;condition&#8217; =&gt; &#8217;1&#8242;,<br />
			&#8216;order&#8217; =&gt; &#8217;1&#8242;,<br />
			&#8216;limit&#8217; =&gt; 100000,<br />
			&#8216;groupby&#8217; =&gt;&#8221;<br />
		);<br />
		$options = array_merge($default,$options);</p>
<p>		//modificacion group by<br />
		if($options['groupby']==&#8221;)<br />
			$sql = &quot;SELECT {$options['fields']} FROM {$options['table']} WHERE {$options['condition']} ORDER BY {$options['order']} LIMIT {$options['limit']}&quot;;<br />
		else<br />
			$sql = &quot;SELECT {$options['fields']} FROM {$options['table']} WHERE {$options['condition']} GROUP BY {$options['groupby']} ORDER BY {$options['order']} LIMIT {$options['limit']}&quot;;</p>
<p>		return $this-&gt;query($sql);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cib</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-7149</link>
		<dc:creator>cib</dc:creator>
		<pubDate>Mon, 19 Mar 2012 22:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-7149</guid>
		<description>in short tags, where do I need additional security from sql injection
e.g.
$data = array(
	// have to escape this?
	&#039;name&#039; =&gt; mysql_real_escape_string($var),
);
$result = $m-&gt;insert(&#039;users&#039;,$data);</description>
		<content:encoded><![CDATA[<p>in short tags, where do I need additional security from sql injection</p>
<p>e.g.<br />
$data = array(<br />
	// have to escape this?<br />
	&#8216;name&#8217; =&gt; mysql_real_escape_string($var),<br />
);<br />
$result = $m-&gt;insert(&#8216;users&#8217;,$data);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arsibux</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-6962</link>
		<dc:creator>arsibux</dc:creator>
		<pubDate>Wed, 07 Mar 2012 15:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-6962</guid>
		<description>fantastic work thanx bro</description>
		<content:encoded><![CDATA[<p>fantastic work thanx bro</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codingquery</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-6293</link>
		<dc:creator>codingquery</dc:creator>
		<pubDate>Fri, 10 Feb 2012 05:36:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-6293</guid>
		<description>this is a really a nice posing. i have my own blog and i really appreciate this as because i have used this classes and it really works a lot. It will increase the security and productivity as well.
i have a very simple class tutorial on the same topic. if you found this class quite turf to understand you can give a loot to my tutorial.
http://www.codingquery.com/php-mysql-connection-class-source-code</description>
		<content:encoded><![CDATA[<p>this is a really a nice posing. i have my own blog and i really appreciate this as because i have used this classes and it really works a lot. It will increase the security and productivity as well. </p>
<p>i have a very simple class tutorial on the same topic. if you found this class quite turf to understand you can give a loot to my tutorial.</p>
<p><a href="http://www.codingquery.com/php-mysql-connection-class-source-code" rel="nofollow">http://www.codingquery.com/php-mysql-connection-class-source-code</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A to Z of the world</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-6200</link>
		<dc:creator>A to Z of the world</dc:creator>
		<pubDate>Tue, 07 Feb 2012 09:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-6200</guid>
		<description>Cool.  Would sure come back to give more suggestions once I start using it.</description>
		<content:encoded><![CDATA[<p>Cool.  Would sure come back to give more suggestions once I start using it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-3362</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 22 Nov 2011 13:51:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-3362</guid>
		<description>Really nice one I&#039;ll post some functions for anyone who wants to extend this class :
/**
	  *
	  * This function returns the field names of a table
	  *
	  *
	  * @param string $result the mysql resource pointer to a query
	  * @return returns a 2D array with the field names
	  */
    public function get_fields($result)
    {
        $row = $this-&gt;fetchAssoc($result);
        if($row==TRUE)
            return array_keys($row);
        else
            return false;
    }
	/**
	  * prevent sql injections
 	  *
	  */
    public function prevent_injection($value) {
        // Stripslashes
        if (get_magic_quotes_gpc()) {
            $value = stripslashes($value);
        }
        // Quote if not a number or a numeric string
        if (!is_numeric($value)) {
            $value = mysql_real_escape_string($value);
        }
        return $value;
    }</description>
		<content:encoded><![CDATA[<p>Really nice one I&#8217;ll post some functions for anyone who wants to extend this class :</p>
<p>/**<br />
	  *<br />
	  * This function returns the field names of a table<br />
	  *<br />
	  *<br />
	  * @param string $result the mysql resource pointer to a query<br />
	  * @return returns a 2D array with the field names<br />
	  */<br />
    public function get_fields($result)<br />
    {<br />
        $row = $this-&gt;fetchAssoc($result);</p>
<p>        if($row==TRUE)<br />
            return array_keys($row);<br />
        else<br />
            return false;<br />
    }<br />
	/**<br />
	  * prevent sql injections<br />
 	  *<br />
	  */<br />
    public function prevent_injection($value) {<br />
        // Stripslashes<br />
        if (get_magic_quotes_gpc()) {<br />
            $value = stripslashes($value);<br />
        }<br />
        // Quote if not a number or a numeric string<br />
        if (!is_numeric($value)) {<br />
            $value = mysql_real_escape_string($value);<br />
        }<br />
        return $value;<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helper Palestinian Developer</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-2694</link>
		<dc:creator>Helper Palestinian Developer</dc:creator>
		<pubDate>Wed, 05 Oct 2011 13:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-2694</guid>
		<description>good class, and good tutorial
thank you</description>
		<content:encoded><![CDATA[<p>good class, and good tutorial </p>
<p>thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helper Palestinian Developer</title>
		<link>http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/comment-page-1/#comment-2693</link>
		<dc:creator>Helper Palestinian Developer</dc:creator>
		<pubDate>Wed, 05 Oct 2011 13:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mbe.ro/?p=114#comment-2693</guid>
		<description>foreach ($result as $key)
	foreach ($key as $key) {
		echo $key[&quot;fieldname&quot;];
	}</description>
		<content:encoded><![CDATA[<p>foreach ($result as $key)<br />
	foreach ($key as $key) {<br />
		echo $key[&quot;fieldname&quot;];<br />
	}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

