<?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: Writing Secure SQL Queries</title>
	<atom:link href="http://phpstarter.net/2008/02/writing-secure-sql-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpstarter.net/2008/02/writing-secure-sql-queries/</link>
	<description>PHP Tips &#38; Tools From Starters to Experts</description>
	<lastBuildDate>Sun, 15 Jan 2012 02:04:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Matt</title>
		<link>http://phpstarter.net/2008/02/writing-secure-sql-queries/comment-page-1/#comment-4</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 03 Mar 2008 06:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://wp.pr0gr4mm3r.com/mysql/writing-secure-sql-queries/#comment-4</guid>
		<description>I knew about SQL injection, but I actually never tried it. I copied your sample into a login form on my site (after removing the escape logic), and it does work. Neat-O! (I had to replace all those funky quotes in your sample code though).

I escape the user input in my PHP code with this function:
[code language=&#039;php&#039;]
function escapeData($data)
{
	if(ini_get(&#039;magic_quotes_gpc&#039;))
		$data = stripslashes($data);
	return mysql_real_escape_string($data);
}
[/code]
It&#039;s more portable than just using mysql_real_escape_string() everywhere.</description>
		<content:encoded><![CDATA[<p>I knew about SQL injection, but I actually never tried it. I copied your sample into a login form on my site (after removing the escape logic), and it does work. Neat-O! (I had to replace all those funky quotes in your sample code though).</p>
<p>I escape the user input in my PHP code with this function:</p>
<pre class="brush: php">
function escapeData($data)
{
	if(ini_get(&#039;magic_quotes_gpc&#039;))
		$data = stripslashes($data);
	return mysql_real_escape_string($data);
}
</pre>
<p>It&#8217;s more portable than just using mysql_real_escape_string() everywhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Wells</title>
		<link>http://phpstarter.net/2008/02/writing-secure-sql-queries/comment-page-1/#comment-5</link>
		<dc:creator>Andrew Wells</dc:creator>
		<pubDate>Mon, 03 Mar 2008 05:21:36 +0000</pubDate>
		<guid isPermaLink="false">http://wp.pr0gr4mm3r.com/mysql/writing-secure-sql-queries/#comment-5</guid>
		<description>Yeah, Wordpress likes to mess with my quotes.  I have been looking into how to disable that fancy formatting.

That&#039;s a good idea with putting in that magic quotes test.  I was escaping strings on this one server, and everything was being outputted with extra backslashes.  Turned out it was because &quot;magic_quotes_gpc&quot; was enabled.  I always disable that function whenever possible because I secure it myself.</description>
		<content:encoded><![CDATA[<p>Yeah, WordPress likes to mess with my quotes.  I have been looking into how to disable that fancy formatting.</p>
<p>That&#8217;s a good idea with putting in that magic quotes test.  I was escaping strings on this one server, and everything was being outputted with extra backslashes.  Turned out it was because &#8220;magic_quotes_gpc&#8221; was enabled.  I always disable that function whenever possible because I secure it myself.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

