<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx</link><description>How to prevent SQL injection in PHP scripts is probably a topic that doesn’t need anything more written about it. It is pretty easy to find blog posts, documentation, videos, etc. that explain the importance of preventing SQL injection and suggestions</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10391922</link><pubDate>Thu, 07 Feb 2013 16:58:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10391922</guid><dc:creator>Mathankumar G</dc:creator><description>&lt;p&gt;hi,its very useful information but its support mysql or only sql etc.,??&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10391922" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10149366</link><pubDate>Mon, 04 Apr 2011 03:29:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10149366</guid><dc:creator>Brian Swan - MSFT</dc:creator><description>&lt;p&gt;I&amp;#39;d be interested to see exactly how this vulnerable to &amp;quot;blind SQL injection&amp;quot;. Can you elaborate?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10149366" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10149365</link><pubDate>Mon, 04 Apr 2011 03:25:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10149365</guid><dc:creator>Donkey Kong</dc:creator><description>&lt;p&gt;Sorry to tell you but the above code is vulnerable to blind SQL injection. You may wish to try input sanitizeation. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10149365" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10131625</link><pubDate>Fri, 18 Feb 2011 22:21:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10131625</guid><dc:creator>thejoester</dc:creator><description>&lt;p&gt;I had a database that got hacked in this way before discovering the above solution to it I wrote the login script a tad differently, I first do a count statement that does &amp;quot;SELECT COUNT(username) as count FROM user_table WHERE username=&amp;#39;$username&amp;#39; AND password=&amp;#39;$password&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;then only if the count = 1 do I actually query the database with the SELECT statement to get user information. I found this way works, though there is more code and may not be as good of a solution. &lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10131625" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10129046</link><pubDate>Mon, 14 Feb 2011 16:17:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10129046</guid><dc:creator>Brian Swan - MSFT</dc:creator><description>&lt;p&gt;@abdulsalam almekhlafi-&lt;/p&gt;
&lt;p&gt;Feel free to re-post this article with a link back to the source.&lt;/p&gt;
&lt;p&gt;Glad you found it helpful.&lt;/p&gt;
&lt;p&gt;-Brian&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10129046" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10128763</link><pubDate>Sun, 13 Feb 2011 21:15:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10128763</guid><dc:creator>abdulsalam almekhlafi</dc:creator><description>&lt;p&gt;Very good article and nice explain&lt;/p&gt;
&lt;p&gt;I want to post this article on my web site &lt;a rel="nofollow" target="_new" href="http://www.almekhlafi.com"&gt;http://www.almekhlafi.com&lt;/a&gt; with write this site source if you no have any problem&lt;/p&gt;
&lt;p&gt;Thankyou&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10128763" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#10053122</link><pubDate>Mon, 23 Aug 2010 13:40:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10053122</guid><dc:creator>Warjat</dc:creator><description>&lt;p&gt;Great post, thanks.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve somewhat new to PHP/SQL logins, and although I can build a login system, I always knew that I was lacking in the department of security. This brings me one step closer to make my logins more secure. Thanks!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10053122" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#9978807</link><pubDate>Mon, 15 Mar 2010 16:39:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9978807</guid><dc:creator>Brian Swan - MSFT</dc:creator><description>&lt;p&gt;@Craig: Glad to hear you are making progress. I'd be interested in the details of your final solution. You can e-mail me at brian.swan 'at' microsoft 'dot' com. Let me know if you need help with anything else.&lt;/p&gt;
&lt;p&gt;-Brian &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9978807" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#9978774</link><pubDate>Mon, 15 Mar 2010 15:53:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9978774</guid><dc:creator>Craig Marvelley</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;Just wanted to let you know that I looked into your suggestions; something like that would be perfect. PDOStatement::bindParam() does have a 'data_type' parameter, but I don't think it's comparable &amp;nbsp;since its not driver-specific. It didn't make a difference to my queries, anyway!&lt;/p&gt;
&lt;p&gt;There's a generic 'driver specific options' parameter that could be suitable for something like this, but I can't find a reference to its use in the documentation or in the source of the PDO ODBC extension. Patching the extension to support a type hint through that parameter is a possibility that I'm looking into.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9978774" width="1" height="1"&gt;</description></item><item><title>re: What's the Right Way to Prevent SQL Injection in PHP Scripts?</title><link>http://blogs.msdn.com/b/brian_swan/archive/2010/03/04/what_2700_s-the-right-way-to-avoid-sql-injection-in-php-scripts_3F00_.aspx#9975876</link><pubDate>Tue, 09 Mar 2010 23:51:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9975876</guid><dc:creator>Brian Swan - MSFT</dc:creator><description>&lt;p&gt;@Joe: Thanks for the comments. Some good food for thought. If I could generalize your comment about only using a RDBMS when you really need it, I'd say you should use the right tool for the right job. I think that rule applies to programming languages too. Personally, I've found PHP easier to pick up than Visual Basic or C#. Sometimes, being able to develop quickly fits the &amp;quot;right tool for the right job&amp;quot; requirement. And, as I learn more PHP, I'm finding that the writing secure, maintainable, well-architected code is becoming easier and easier.&lt;/p&gt;
&lt;p&gt;-Brian&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9975876" width="1" height="1"&gt;</description></item></channel></rss>