<?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: Protecting MySQL from SQL Injection Attacks with PHP.</title>
	<atom:link href="http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/</link>
	<description>Simon J. Greenhill's Website</description>
	<lastBuildDate>Wed, 27 Jan 2010 10:46:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon</title>
		<link>http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/comment-page-1/#comment-3667</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Sun, 22 Feb 2009 19:57:59 +0000</pubDate>
		<guid isPermaLink="false">http://simon.net.nz/php/protecting_mysql_from_sql_injection_attacks_in_php/#comment-3667</guid>
		<description>Eberhard  - yeah, this article is really old now! There are many better ways of doing things, like PDO.

--Simon</description>
		<content:encoded><![CDATA[<p>Eberhard  &#8211; yeah, this article is really old now! There are many better ways of doing things, like PDO.</p>
<p>&#8211;Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eberhard Doerr</title>
		<link>http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/comment-page-1/#comment-3666</link>
		<dc:creator>Eberhard Doerr</dc:creator>
		<pubDate>Fri, 20 Feb 2009 15:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://simon.net.nz/php/protecting_mysql_from_sql_injection_attacks_in_php/#comment-3666</guid>
		<description>In PHP5 the PDO library is recommended for DB access. 
It contains a quote() method:
&quot;PDO::quote() places quotes around the input string (if required) and escapes special characters within the input string, using a quoting style appropriate to the underlying driver.&quot;
http://de2.php.net/manual/en/pdo.quote.php

So this makes your code independent of the specific database, like when you want to switch from MySQL to PostgreSQL (which would be wise IMO ;-)

There is also a PDO::prepare() method that might be considered in this context.</description>
		<content:encoded><![CDATA[<p>In PHP5 the PDO library is recommended for DB access.<br />
It contains a quote() method:<br />
&#8220;PDO::quote() places quotes around the input string (if required) and escapes special characters within the input string, using a quoting style appropriate to the underlying driver.&#8221;<br />
<a href="http://de2.php.net/manual/en/pdo.quote.php" rel="nofollow">http://de2.php.net/manual/en/pdo.quote.php</a></p>
<p>So this makes your code independent of the specific database, like when you want to switch from MySQL to PostgreSQL (which would be wise IMO <img src='http://simon.net.nz/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>There is also a PDO::prepare() method that might be considered in this context.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jalone</title>
		<link>http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/comment-page-1/#comment-3664</link>
		<dc:creator>jalone</dc:creator>
		<pubDate>Mon, 01 Dec 2008 00:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://simon.net.nz/php/protecting_mysql_from_sql_injection_attacks_in_php/#comment-3664</guid>
		<description>Thanks!at last i understand evrything well!  there&#039;s so much confusion about this argumentù
Lorenzo</description>
		<content:encoded><![CDATA[<p>Thanks!at last i understand evrything well!  there&#8217;s so much confusion about this argumentù<br />
Lorenzo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/comment-page-1/#comment-3167</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Sat, 25 Aug 2007 01:51:01 +0000</pubDate>
		<guid isPermaLink="false">http://simon.net.nz/php/protecting_mysql_from_sql_injection_attacks_in_php/#comment-3167</guid>
		<description>Thanks Tux, 

I agree with you there (which is why I have that &lt;i&gt;clean_int&lt;/i&gt; function described above - I also have an uncomfortable feeling about relying on &lt;i&gt;quote_smart&lt;/i&gt; to do the quoting of string fields for me). 

The programmer MUST know what the value is before s/he sends it off to the database, and what s/he&#039;s trying to store. As a programmer, it&#039;s a really good idea to think &lt;em&gt;very&lt;/em&gt; carefully about what data you are likely to get entered, and what you&#039;ll do if it&#039;s &lt;strong&gt;not&lt;/strong&gt; alright, and most importantly, how can you deal with this situation gracefully. 

--Simon</description>
		<content:encoded><![CDATA[<p>Thanks Tux, </p>
<p>I agree with you there (which is why I have that <i>clean_int</i> function described above &#8211; I also have an uncomfortable feeling about relying on <i>quote_smart</i> to do the quoting of string fields for me). </p>
<p>The programmer MUST know what the value is before s/he sends it off to the database, and what s/he&#8217;s trying to store. As a programmer, it&#8217;s a really good idea to think <em>very</em> carefully about what data you are likely to get entered, and what you&#8217;ll do if it&#8217;s <strong>not</strong> alright, and most importantly, how can you deal with this situation gracefully. </p>
<p>&#8211;Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TuxLives</title>
		<link>http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/comment-page-1/#comment-3163</link>
		<dc:creator>TuxLives</dc:creator>
		<pubDate>Fri, 24 Aug 2007 15:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://simon.net.nz/php/protecting_mysql_from_sql_injection_attacks_in_php/#comment-3163</guid>
		<description>My only issue lies here: quote_smart($value); The programmer should know what kind of data (and key) is expected so there really is no reason to throw in another evaluation into the mix (IE: &quot;guessing about the data&quot;).

I would instead have one to clean strings (clean_string( $value, $DB );)  and a second one that handles integer based data. Use them when and where you need them.

Programmers should be careful and precise.

But, we need more articles that are thorough in the examples, well done.</description>
		<content:encoded><![CDATA[<p>My only issue lies here: quote_smart($value); The programmer should know what kind of data (and key) is expected so there really is no reason to throw in another evaluation into the mix (IE: &#8220;guessing about the data&#8221;).</p>
<p>I would instead have one to clean strings (clean_string( $value, $DB );)  and a second one that handles integer based data. Use them when and where you need them.</p>
<p>Programmers should be careful and precise.</p>
<p>But, we need more articles that are thorough in the examples, well done.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
