<?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: The ins and outs of SQL injection</title>
	<atom:link href="http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Wed, 10 Mar 2010 23:17:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tintin</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-73</link>
		<dc:creator>Tintin</dc:creator>
		<pubDate>Sun, 08 Mar 2009 07:10:46 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-73</guid>
		<description>About the html entities, can you give samples like the ones above. 

Thanks.</description>
		<content:encoded><![CDATA[<p>About the html entities, can you give samples like the ones above. </p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hasni</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-70</link>
		<dc:creator>hasni</dc:creator>
		<pubDate>Sat, 28 Feb 2009 10:22:39 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-70</guid>
		<description>this is wonderful tutorial .. i read it 3 times and get a fantastic results and sure i put a 
copy of this lesson on my site here

http://www.hasni.org</description>
		<content:encoded><![CDATA[<p>this is wonderful tutorial .. i read it 3 times and get a fantastic results and sure i put a<br />
copy of this lesson on my site here</p>
<p><a href="http://www.hasni.org" rel="nofollow">http://www.hasni.org</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adje</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-68</link>
		<dc:creator>Adje</dc:creator>
		<pubDate>Wed, 18 Feb 2009 02:18:28 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-68</guid>
		<description>Great article! In addition to addslashes, I thought I'd suggest some other methods. If you are allowing special characters and the text is going to be posted (e.g. in a comment form) I've found htmlentities() is an excellent function to prevent injection. It'll turn any special character into benign jumble to SQL and when posted will display as it was entered. Just a suggestion!</description>
		<content:encoded><![CDATA[<p>Great article! In addition to addslashes, I thought I&#8217;d suggest some other methods. If you are allowing special characters and the text is going to be posted (e.g. in a comment form) I&#8217;ve found htmlentities() is an excellent function to prevent injection. It&#8217;ll turn any special character into benign jumble to SQL and when posted will display as it was entered. Just a suggestion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason kenny</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-37</link>
		<dc:creator>jason kenny</dc:creator>
		<pubDate>Sat, 17 Jan 2009 07:40:10 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-37</guid>
		<description>Nice writing. You are on my RSS reader now so I can read more from you down the road.</description>
		<content:encoded><![CDATA[<p>Nice writing. You are on my RSS reader now so I can read more from you down the road.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: b7ral7nen</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-17</link>
		<dc:creator>b7ral7nen</dc:creator>
		<pubDate>Thu, 11 Dec 2008 00:05:13 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-17</guid>
		<description>this is wonderful tutorial .. i read it 3 times and get a fantastic results and sure i put a
copy of this lesson on my site</description>
		<content:encoded><![CDATA[<p>this is wonderful tutorial .. i read it 3 times and get a fantastic results and sure i put a<br />
copy of this lesson on my site</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: comman</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-15</link>
		<dc:creator>comman</dc:creator>
		<pubDate>Wed, 10 Dec 2008 08:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-15</guid>
		<description>very nice its lesson
very well explained!
thank you very mach</description>
		<content:encoded><![CDATA[<p>very nice its lesson<br />
very well explained!<br />
thank you very mach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frida</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-13</link>
		<dc:creator>Frida</dc:creator>
		<pubDate>Mon, 08 Dec 2008 15:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-13</guid>
		<description>You can use bind parameters with php and mysql, but you need to use PHP Data Obejcts.

Check out these links for more info:
http://www.metonymie.com/codewerks/2008/05/07/using-pdo-in-php-with-mysql.html
http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html#10</description>
		<content:encoded><![CDATA[<p>You can use bind parameters with php and mysql, but you need to use PHP Data Obejcts.</p>
<p>Check out these links for more info:<br />
<a href="http://www.metonymie.com/codewerks/2008/05/07/using-pdo-in-php-with-mysql.html" rel="nofollow">http://www.metonymie.com/codewerks/2008/05/07/using-pdo-in-php-with-mysql.html</a><br />
<a href="http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html#10" rel="nofollow">http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html#10</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike M</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-11</link>
		<dc:creator>Mike M</dc:creator>
		<pubDate>Fri, 05 Dec 2008 19:20:54 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-11</guid>
		<description>In the examples above the entire sql command is built into a string and the string is given to the database to execute.  hopefully the components of the string have been validated so the command you intend to run is actually run.

I'm not sure if php+mysql can bind parameters yet, I use php+sql server and it can.

Running stored procedures with bound parameters occurs as follows.  You create a stored procedure, which is like a function, but stored within the database and contains in/out parameters, result sets, and programming logic.  In php you generally instantiate a database object, using methods you make a connection, add parameters, name the stored procedure, tell it to run the stored procedure.  After that, you can interrogate the return code, out parameters, as well as loop though result sets.  You never build a sql string.  You say: parameter X is integer and here is the value of it, parameter Y is string and here is the value, you say the name of the stored procedure is ABC, you then say run the stored procedure, etc.  There is no way to put fake values into the parameters and cause a different/extra sql command to run.

look at the "Example #1 mssql_bind() example" code here for a good example:
http://us3.php.net/manual/en/function.mssql-bind.php</description>
		<content:encoded><![CDATA[<p>In the examples above the entire sql command is built into a string and the string is given to the database to execute.  hopefully the components of the string have been validated so the command you intend to run is actually run.</p>
<p>I&#8217;m not sure if php+mysql can bind parameters yet, I use php+sql server and it can.</p>
<p>Running stored procedures with bound parameters occurs as follows.  You create a stored procedure, which is like a function, but stored within the database and contains in/out parameters, result sets, and programming logic.  In php you generally instantiate a database object, using methods you make a connection, add parameters, name the stored procedure, tell it to run the stored procedure.  After that, you can interrogate the return code, out parameters, as well as loop though result sets.  You never build a sql string.  You say: parameter X is integer and here is the value of it, parameter Y is string and here is the value, you say the name of the stored procedure is ABC, you then say run the stored procedure, etc.  There is no way to put fake values into the parameters and cause a different/extra sql command to run.</p>
<p>look at the &#8220;Example #1 mssql_bind() example&#8221; code here for a good example:<br />
<a href="http://us3.php.net/manual/en/function.mssql-bind.php" rel="nofollow">http://us3.php.net/manual/en/function.mssql-bind.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thales</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-9</link>
		<dc:creator>Thales</dc:creator>
		<pubDate>Thu, 04 Dec 2008 14:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-9</guid>
		<description>What is a bind parameter?</description>
		<content:encoded><![CDATA[<p>What is a bind parameter?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike M</title>
		<link>http://thephpblog.com/read/the-ins-and-outs-of-sql-injection/comment-page-1/#comment-7</link>
		<dc:creator>Mike M</dc:creator>
		<pubDate>Mon, 01 Dec 2008 15:24:07 +0000</pubDate>
		<guid isPermaLink="false">http://thephpblog.com/?p=42#comment-7</guid>
		<description>The best way to avoid any injection is to only use stored procedures with bound parameters.  I'm not sure MySQL can do this yet, the last time I checked you could use stored procedures but you couldn't bind parameters.  I use SQL Server and every database call goes through stored procedures with bound parameters and there is zero chance of an injection attack.</description>
		<content:encoded><![CDATA[<p>The best way to avoid any injection is to only use stored procedures with bound parameters.  I&#8217;m not sure MySQL can do this yet, the last time I checked you could use stored procedures but you couldn&#8217;t bind parameters.  I use SQL Server and every database call goes through stored procedures with bound parameters and there is zero chance of an injection attack.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
