<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TheUnical Technologies Blog &#187; MySql</title>
	<atom:link href="http://blog.theunical.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.theunical.com</link>
	<description>TheUnical Technologies Official Blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 21:46:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Asia&#8217;s Largest Open Source Conference! In Chennai INDIA</title>
		<link>http://blog.theunical.com/javascript/asias-largest-open-source-conference-in-chennai-india/</link>
		<comments>http://blog.theunical.com/javascript/asias-largest-open-source-conference-in-chennai-india/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 04:57:47 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[Technology News]]></category>
		<category><![CDATA[CouchDB]]></category>
		<category><![CDATA[Ingres]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Open Source Conference]]></category>
		<category><![CDATA[PHP 5]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQLite & Others]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=306684</guid>
		<description><![CDATA[Asia&#8217;s largest conference on open source, to be held from 19th-21st September, 2010 at Chennai, India (more: http://osidays.com). OSI Days 2010 is the 7th and latest conference in the rich legacy established by the Linux Asia series of conference in India. Organised by the Forum for Open Source Initiatives in India (FOSII) and the Linux [...]]]></description>
			<content:encoded><![CDATA[<p>Asia&#8217;s largest conference on open source, to be held from 19th-21st September, 2010 at Chennai, India (more: <a href="http://massmail.efydigital.com/efy/lt.php?id=fE9VA1UeAVFcHgYFAAcHAxhGB1pTFFkSXlhWT1JXW1FfXAhRAFp0BQgDW10dUV9f" target="_blank">http://osidays.com</a>).</p>
<p>OSI Days 2010 is the 7th and latest conference in the rich legacy established by the Linux Asia series of conference in India. Organised by the Forum for Open Source Initiatives in India (FOSII) and the Linux for You magazine (part of the EFY Group), OSI Days serves as the focal point for the convergence of the Open Source Community and Industry in Asia.</p>
<p>The conference is targeted at the Policy &amp; Decision makers in a technological ecosystem &#8211; Government, Academicians, CXOs, SMEs, Developers and hardcore hackers. OSI Days 2010 will bring together over 3000 of the finest people in the open source domain together to discuss and confer on varied and relevant topics including:</p>
<ul>
<li>Mobile: App Development, Game Development, Android,      iPhone, Symbian &amp; Others</li>
<li><strong>IT Managers / Business: Legal, Community Management,      Best Practices, Marketing Strategies, Open Web / Standardization, Business      Models </strong></li>
<li>Cloud Computing: Tools and Platforms, Cloudnomics,      Cloud for Dummies &amp; Others</li>
<li>Government: Applications, eGovernance , Case Study,      Legal</li>
<li>Hardware: Infrastructure Management, Security, Semi      Embedded Devices, Parallelization, Grid, Multi Core, Multi Threading,      Virtualization &amp; Others</li>
<li><strong>PHP: PHP 5 &amp; 6, PHP Security, Frameworks,      Architecture / QA &amp; Best Practices </strong></li>
<li><strong>Ruby on Rails </strong></li>
<li><strong>Drupal: Best Practices, Module Development, Theme      Development, Scaling/ Management/ Performance &amp; Others </strong></li>
<li><strong>Databases: MySQL, NoSQL, CouchDB, PostgreSQL, Ingres,      SQLite &amp; Others </strong></li>
<li><strong>Java Script </strong></li>
<li><strong>Developer / Tools &amp; Techniques </strong></li>
</ul>
<p>(For details: please See the conference schedule at: <a href="http://massmail.efydigital.com/efy/lt.php?id=fE9VA1QeAVFcHgYFAAcHAxhGB1pTFFkSXlhWT1JXW1FfXAhRAFp0BQgDW10dUV9f" target="_blank">http://osidays.com/schedule</a>)</p>
<p>The Call for Papers are open for the conference till June 15th (more: <a href="http://massmail.efydigital.com/efy/lt.php?id=fE9VA1ceAVFcHgYFAAcHAxhGB1pTFFkSXlhWT1JXW1FfXAhRAFp0BQgDW10dUV9f" target="_blank">http://osidays.com/call-for-papers</a>). We invite you to come join us in promoting open source technologies and projects by participating at the confernce as speakers and contributing to the knowledge and wisdom at OSI Days 2010.</p>
<p>For any clarifications,<br />
Dhiraj Khare<br />
OSI Days 2010<br />
<a href="mailto:dhiraj@osidays.com" target="_blank">dhiraj@osidays.com</a></p>
<p>Schedule at a Glance</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="28" valign="top">
<p align="left">
</td>
<td width="106" valign="top">
<p align="center"><strong>A</strong></p>
</td>
<td width="121" valign="top">
<p align="center"><strong>B</strong></p>
</td>
<td width="110" valign="top">
<p align="center"><strong>C</strong></p>
</td>
<td width="135" valign="top">
<p align="center"><strong>D</strong></p>
</td>
<td width="141" valign="top">
<p align="center"><strong>E</strong></p>
</td>
</tr>
<tr>
<td rowspan="2" width="28" valign="top">
<p align="center"><strong>S</strong></p>
<p align="center"><strong>U</strong></p>
<p align="center"><strong>N</strong></p>
<p align="center"><strong>D</strong></p>
<p align="center"><strong>A</strong></p>
<p align="center"><strong>Y</strong></p>
</td>
<td width="106">
<p align="center"><strong>Panel Discussions</strong></p>
<p align="center">
<p align="center">FOSS for Everyone</p>
<p align="center">
<p align="center">
</td>
<td rowspan="2" width="121" valign="top">
<p align="center"><strong>Sessions</strong></p>
<p align="center">
<p align="center"><a href="http://osidays.com/session/php" target="_blank">PHP</a></p>
<p align="center">
</td>
<td rowspan="2" width="110" valign="top">
<p align="center"><strong>Sessions</strong></p>
<p align="center">
<p align="center"><a href="http://osidays.com/session/drupal" target="_blank">Drupal</a></p>
<p align="center">
</td>
<td rowspan="2" width="135" valign="top">
<p align="center"><strong><a href="http://osidays.com/tutorials" target="_blank">Training/Workshop</a></strong></p>
<p align="center">
<p align="center">Mobile Application Development</p>
</td>
<td rowspan="2" width="141" valign="top">
<p align="center"><strong><a href="http://osidays.com/tutorials" target="_blank">Training/Workshop</a></strong></p>
<p align="center">
<p align="center">Zend Certification Training</p>
</td>
</tr>
<tr>
<td width="106" valign="top">
<p align="center"><strong>FOSS Awards</strong></p>
</td>
</tr>
<tr>
<td width="28" valign="top">
<p align="center"><strong>M</strong></p>
<p align="center"><strong>O</strong></p>
<p align="center"><strong>N</strong></p>
<p align="center"><strong>D</strong></p>
<p align="center"><strong>A</strong></p>
<p align="center"><strong>Y</strong></p>
</td>
<td width="106" valign="top">
<p align="center"><strong>Panel Discussions</strong></p>
<p align="center"><strong> </strong></p>
<p>IT Dev Web</td>
<td width="121" valign="top">
<p align="center"><strong>Sessions</strong></p>
<p align="center">
<p align="center">
<p align="center"><a href="http://osidays.com/session/php" target="_blank">PHP</a></p>
</td>
<td width="110" valign="top">
<p align="center"><strong>Panel Discussions</strong></p>
<p align="center"><strong> </strong></p>
<p align="center">IT Implementer</p>
<p align="center">
</td>
<td width="135" valign="top">
<p align="center"><strong><a href="http://osidays.com/tutorials" target="_blank">Training/Workshop</a></strong></p>
<p align="center">
<p align="center">MySQL</p>
</td>
<td width="141" valign="top">
<p align="center"><strong><a href="http://osidays.com/tutorials" target="_blank">Training/Workshop</a></strong></p>
<p align="center">
<p align="center">TBA</p>
</td>
</tr>
<tr>
<td rowspan="2" width="28" valign="top">
<p align="center"><strong>T</strong></p>
<p align="center"><strong>U</strong></p>
<p align="center"><strong>E</strong></p>
<p align="center"><strong>S</strong></p>
<p align="center"><strong>D</strong></p>
<p align="center"><strong>A</strong></p>
<p align="center"><strong>Y</strong></p>
</td>
<td rowspan="2" width="106" valign="top">
<p align="center"><strong> </strong></p>
<p align="center"><strong> </strong></p>
<p align="center">IT Dev Mob</p>
<p align="center"><strong> </strong></p>
<p align="center"><strong> </strong></p>
</td>
<td width="121" valign="top">
<p align="center"><strong>Sessions</strong></p>
<p align="center">Open Source Databases</p>
<p align="center">
</td>
<td rowspan="2" width="110" valign="top">
<p align="center"><strong> </strong></p>
<p align="center"><strong> </strong></p>
<p align="center"><strong>CXO Summit</strong></p>
<p align="center">
<p align="center">
</td>
<td rowspan="2" width="135" valign="top">
<p align="center"><strong><a href="http://osidays.com/tutorials" target="_blank">Training/Workshop</a></strong></p>
<p align="center">
<p align="center">TBA</p>
</td>
<td rowspan="2" width="141" valign="top">
<p align="center"><strong><a href="http://osidays.com/tutorials" target="_blank">Training/Workshop</a></strong></p>
<p align="center">
<p align="center">Open Source Databases</p>
<p align="center">
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/javascript/asias-largest-open-source-conference-in-chennai-india/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to set different port no for MySql database in Magento</title>
		<link>http://blog.theunical.com/ecommerce/shopping-carts/magento-cart/how-to-set-different-port-no-for-mysql-database-in-magento/</link>
		<comments>http://blog.theunical.com/ecommerce/shopping-carts/magento-cart/how-to-set-different-port-no-for-mysql-database-in-magento/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 13:05:31 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Magento Cart]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Shopping Carts]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql port no]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=305916</guid>
		<description><![CDATA[How to set different port no for mysql database in Magento Open the Configuration file where you setup database properties, i.e app/etc/local.xml Just Replace the PORTNO in below xml with your port number. &#60;default_setup&#62; &#60;connection&#62; &#60;host&#62;&#60;![CDATA[HOSTADDRESS]]&#62;&#60;/host&#62; &#60;username&#62;&#60;![CDATA[USERNAME]]&#62;&#60;/username&#62; &#60;password&#62;&#60;![CDATA[PASSWORD]]&#62;&#60;/password&#62; &#60;dbname&#62;&#60;![CDATA[DBNAME]]&#62;&#60;/dbname&#62; &#60;port&#62;&#60;![CDATA[PORTNO]]&#62;&#60;/port&#62; &#60;active&#62;1&#60;/active&#62; &#60;/connection&#62; &#60;/default_setup&#62;]]></description>
			<content:encoded><![CDATA[<p>How to set different port no for mysql database in Magento</p>
<p>Open the Configuration file where you setup database properties, i.e app/etc/<em>local</em>.<em>xml</em></p>
<p>Just Replace the PORTNO in below xml with your port number.</p>
<pre class="brush: xml">&lt;default_setup&gt;

&lt;connection&gt;

&lt;host&gt;&lt;![CDATA[HOSTADDRESS]]&gt;&lt;/host&gt;

&lt;username&gt;&lt;![CDATA[USERNAME]]&gt;&lt;/username&gt;

&lt;password&gt;&lt;![CDATA[PASSWORD]]&gt;&lt;/password&gt;

&lt;dbname&gt;&lt;![CDATA[DBNAME]]&gt;&lt;/dbname&gt;

&lt;port&gt;&lt;![CDATA[PORTNO]]&gt;&lt;/port&gt;

&lt;active&gt;1&lt;/active&gt;

&lt;/connection&gt;

&lt;/default_setup&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/ecommerce/shopping-carts/magento-cart/how-to-set-different-port-no-for-mysql-database-in-magento/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>List SQL injection tools for exploiting</title>
		<link>http://blog.theunical.com/databases/db-tool/list-sql-injection-tools-for-exploiting/</link>
		<comments>http://blog.theunical.com/databases/db-tool/list-sql-injection-tools-for-exploiting/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 01:39:11 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[DB Tool]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[MS-Sql]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=254932</guid>
		<description><![CDATA[List SQL injection tools for exploiting. sqlmap SQLInjector Bobcat Automagic HacmeBank Absinthe]]></description>
			<content:encoded><![CDATA[<p>List SQL injection tools for exploiting.</p>
<p><strong><a href="http://sqlmap.sourceforge.net/" target="_blank">sqlmap</a></strong></p>
<p><strong><a href="http://www.databasesecurity.com/dbsec/sqlinjector.zip" target="_blank">SQLInjector</a></strong></p>
<p><strong><a href="http://www.northern-monkee.co.uk/projects/bobcat/bin/BobCat_Alphav0.1.zip" target="_blank">Bobcat</a></strong></p>
<p><strong><a href="http://scoobygang.org/automagic.zip" target="_blank">Automagic</a></strong></p>
<p><strong><a href="http://owasp.net/forums/63/ShowPost.aspx" target="_blank">HacmeBank</a></strong></p>
<p><strong><a href="http://www.0x90.org/releases/absinthe/" target="_blank">Absinthe</a></strong></p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/databases/db-tool/list-sql-injection-tools-for-exploiting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Many different SQL Injections variations</title>
		<link>http://blog.theunical.com/databases/ms-sql-server/many-different-sql-injections-variations/</link>
		<comments>http://blog.theunical.com/databases/ms-sql-server/many-different-sql-injections-variations/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 01:28:30 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[MS-Sql]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=254929</guid>
		<description><![CDATA[SQL Injections variations from my collection.. admin’– ‘ or 0=0 – ” or 0=0 – or 0=0 – ‘ or 0=0 # ” or 0=0 # or 0=0 # ‘ or ‘x’=&#8217;x ” or “x”=”x ‘) or (’x&#8217;=’x ‘ or 1=1– ” or 1=1– or 1=1– ‘ or a=a– ” or “a”=”a ‘) or (’a&#8217;=’a [...]]]></description>
			<content:encoded><![CDATA[<p>SQL Injections variations from my collection..</p>
<p>admin’–</p>
<p>‘ or 0=0 –</p>
<p>” or 0=0 –</p>
<p>or 0=0 –</p>
<p>‘ or 0=0 #</p>
<p>” or 0=0 #</p>
<p>or 0=0 #</p>
<p>‘ or ‘x’=&#8217;x</p>
<p>” or “x”=”x</p>
<p>‘) or (’x&#8217;=’x</p>
<p>‘ or 1=1–</p>
<p>” or 1=1–</p>
<p>or 1=1–</p>
<p>‘ or a=a–</p>
<p>” or “a”=”a</p>
<p>‘) or (’a&#8217;=’a</p>
<p>“) or (”a”=”a</p>
<p>hi” or “a”=”a</p>
<p>hi” or 1=1 –</p>
<p>hi’ or 1=1 –</p>
<p>hi’ or ‘a’=&#8217;a</p>
<p>hi’) or (’a&#8217;=’a</p>
<p>hi”) or (”a”=”a</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/databases/ms-sql-server/many-different-sql-injections-variations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql Injection PHP MySql example</title>
		<link>http://blog.theunical.com/databases/mysql/sql-injection-php-mysql-example/</link>
		<comments>http://blog.theunical.com/databases/mysql/sql-injection-php-mysql-example/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 02:47:09 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[MySQL 5.1]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MySql 5.0]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=87210</guid>
		<description><![CDATA[What is SQL Injection SQL injection refers to the act of someone inserting a MySQL statement to be run on your database without your knowledge. Injection usually occurs when you ask a user for input, like their name, and instead of a name they give you a MySQL statement that you will unknowingly run on [...]]]></description>
			<content:encoded><![CDATA[<h2>What is SQL Injection</h2>
<p>SQL injection refers to the act of someone inserting a MySQL statement to be run on your database without your knowledge. Injection usually occurs when you ask a user for input, like their name, and instead of a name they give you a MySQL statement that you will unknowingly run on your database.</p>
<h2>SQL Injection Example</h2>
<p>Below is a sample string that has been gathered from a normal user and a bad user trying to use SQL Injection. We asked the users for their login, which will be used to run a SELECT statement to get their information.</p>
<div>
<h2>MySQL &amp; PHP Code:</h2>
<pre>// a good user's name
$name = "timmy";
$query = "SELECT * FROM customers WHERE username = '$name'";
echo "Normal: " . $query . "&lt;br /&gt;";

// user input that uses SQL Injection
<span style="color: red;">$name_bad = "' OR 1'"</span>; 

// our MySQL query builder, however, not a very safe one
$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'";

// display what the new query will look like, with injection
echo "Injection: " . $query_bad;</pre>
</div>
<h2>Display:</h2>
<div>Normal: SELECT * FROM customers WHERE username = &#8216;timmy&#8217;<br />
Injection: SELECT * FROM customers WHERE username = &#8221; OR 1&#8221;</div>
<p>The normal query is no problem, as our MySQL statement will just select everything from customers that has a username equal to <em>timmy</em>.</p>
<p><strong>However</strong>, the injection attack has actually made our query behave differently than we intended. By using a single quote (&#8216;) they have ended the string part of our MySQL query</p>
<ul>
<li>username = &#8216; &#8216;</li>
</ul>
<p>and then added on to our WHERE statement with an OR clause of 1 (always true).</p>
<ul>
<li>username = &#8216; &#8216; <strong>OR 1 </strong></li>
</ul>
<p>This OR clause of 1 will always be <em>true</em> and so <strong>every single entry</strong> in the &#8220;customers&#8221; table would be selected by this statement!</p>
<h2>More Serious SQL Injection Attacks</h2>
<p>Although the above example displayed a situation where an attacker could possibly get access to a lot of information they shouldn&#8217;t have, the attacks can be a lot worse. For example an attacker could empty out a table by executing a <em>DELETE</em> statement.</p>
<div>
<h2>MySQL &amp; PHP Code:</h2>
<pre><span style="color: red;">$name_evil = "'; DELETE FROM customers WHERE 1 or username = '"</span>; 

// our MySQL query builder really should check for injection
$query_evil = "SELECT * FROM customers WHERE username = '$name_evil'";

// the new evil injection query would include a DELETE statement
echo "Injection: " . $query_evil;</pre>
</div>
<h2>Display:</h2>
<div>SELECT * FROM customers WHERE username = &#8216; &#8216;; DELETE FROM customers WHERE 1 or username = &#8216; &#8216;</div>
<p>If you were run this query, then the injected DELETE statement would completely empty your &#8220;customers&#8221; table. Now that you know this is a problem, how can you prevent it?</p>
<p><strong>Injection Prevention -mysql_real_escape_string()</strong></p>
<p>Lucky for you, this problem has been known for a while and PHP has a specially-made function to prevent these attacks. All you need to do is use the mouthful of a function <em>mysql_real_escape_string</em>.</p>
<p>What <em>mysql_real_escape_string</em> does is take a string that is going to be used in a MySQL query and return the same string with all SQL Injection attempts safely escaped. Basically, it will replace those troublesome quotes(&#8216;) a user might enter with a MySQL-safe substitute, an escaped quote \&#8217;.</p>
<p>Lets try out this function on our two previous injection attacks and see how it works.</p>
<div>
<h2>MySQL &amp; PHP Code:</h2>
<pre>//NOTE: you must be connected to the database to use this function!
// connect to MySQL

$name_bad = "' OR 1'"; 

<span style="color: red;">$name_bad = mysql_real_escape_string($name_bad);</span>

$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'";
echo "Escaped Bad Injection: &lt;br /&gt;" . $query_bad . "&lt;br /&gt;";

$name_evil = "'; DELETE FROM customers WHERE 1 or username = '"; 

<span style="color: red;">$name_evil = mysql_real_escape_string($name_evil);</span>

$query_evil = "SELECT * FROM customers WHERE username = '$name_evil'";
echo "Escaped Evil Injection: &lt;br /&gt;" . $query_evil;</pre>
</div>
<h2>Display:</h2>
<div>Escaped Bad Injection:<br />
SELECT * FROM customers WHERE username = &#8216;\&#8217; OR 1\&#8221;<br />
Escaped Evil Injection:<br />
SELECT * FROM customers WHERE username = &#8216;\&#8217;; DELETE FROM customers WHERE 1 or username = \&#8221;</div>
<p>Notice that those evil quotes have been escaped with a backslash \, preventing the injection attack.  Now all these queries will do is try to find a username that is just completely ridiculous:</p>
<ul>
<li>Bad: \&#8217; OR 1\&#8217;</li>
<li>Evil: \&#8217;; DELETE FROM customers WHERE 1 or username = \&#8217;</li>
</ul>
<p>And I don&#8217;t think we have to worry about those silly usernames getting access to our MySQL database. So please do use the handy <em>mysql_real_escape_string()</em> function to help prevent SQL Injection attacks on your websites.  You have no excuse not to use it after reading this lesson!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/databases/mysql/sql-injection-php-mysql-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to generate a query where dynamic column name? &#8211; MS SQL</title>
		<link>http://blog.theunical.com/databases/ms-sql-server/how-to-generate-a-query-where-dynamic-column-name-ms-sql/</link>
		<comments>http://blog.theunical.com/databases/ms-sql-server/how-to-generate-a-query-where-dynamic-column-name-ms-sql/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 19:40:39 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[MSSql]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/databases/ms-sql-server/how-to-generate-a-query-where-dynamic-column-name-ms-sql/</guid>
		<description><![CDATA[am faced a problem here where is i need to select a query where the column name is dynamic: table a col1 &#124; col2 &#8212;&#8212;&#8212;&#8212;&#8212;- A &#124; Ali B &#124; Steven C &#124; Kawan A &#124; Bayu B &#124; Cawam C &#124; didik how i write a query like below result? declare @T1 table (col1 [...]]]></description>
			<content:encoded><![CDATA[<p>am faced a problem here where is i need to select a query where the column name is dynamic:</p>
<p>table a</p>
<p>col1    |   col2<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
A          |  Ali<br />
B          | Steven<br />
C          | Kawan<br />
A          |  Bayu<br />
B          | Cawam<br />
C          | didik</p>
<p>how i write a query like below result?</p>
<pre class="brush: sql">declare @T1 table (col1 varchar(1),col2 varchar(5))
insert into @T1
select 'A','Ali' union all
select 'B','Abu' union all
select 'C','Kawan' union all
select 'A','Bayu' union all
select 'B','Cawam' union all
select 'C','didik'

if object_id('tempdb..#') is not null
	drop table #
select *
into #
from @T1 a
order by col1

alter table # add flag int
go
declare @i int
set @i = 0
declare @c varchar(10)
set @c = ''
update a set
	@i = case when @c = col1 then @i+1 else 1  end
	,flag = @i
	,@c = col1
from # a

select
	a= max(case when col1 = 'a' then col2 else '' end)
	,b = max(case when col1 = 'b' then col2 else '' end)
	,c =max( case when col1 = 'c' then col2 else '' end)
from #
group by flag</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/databases/ms-sql-server/how-to-generate-a-query-where-dynamic-column-name-ms-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slicehost Setup: Ubuntu + Nginx + PHP + MySQL</title>
		<link>http://blog.theunical.com/php/vinh-pham-%c2%bb-slicehost-setup-ubuntu-nginx-php-mysql/</link>
		<comments>http://blog.theunical.com/php/vinh-pham-%c2%bb-slicehost-setup-ubuntu-nginx-php-mysql/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 00:34:54 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/ubuntu/vinh-pham-%c2%bb-slicehost-setup-ubuntu-nginx-php-mysql/</guid>
		<description><![CDATA[Running Apache on my 256MB slice was not fun. I kept getting “swap” warnings from slicehost, and some mornings I wake up to find my server hung. So I decided to re-install fresh and run Nginx with PHP. Installing Ubuntu (Jaunty), Nginx, PHP, and MySQL is easy following the slicehost guides: http://articles.slicehost.com/ubuntu-intrepid The hard part [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Running Apache on my 256MB slice was not fun. I kept getting “swap” warnings from slicehost, and some mornings I wake up to find my server hung.</p>
<p>So I decided to re-install fresh and run Nginx with PHP.</p>
<p>Installing Ubuntu (Jaunty), Nginx, PHP, and MySQL is easy following the slicehost guides: <a href="http://articles.slicehost.com/ubuntu-intrepid">http://articles.slicehost.com/ubuntu-intrepid</a></p>
<p>The hard part is getting Nginx to work with PHP — You have to enable PHP-CGI.</p>
<p>There are bunch of tutorials out there on how to achieve this, but the most SIMPLE one is here: <a href="http://tomasz.sterna.tv/2009/04/php-fastcgi-with-nginx-on-ubuntu/">http://tomasz.sterna.tv/2009/04/php-fastcgi-with-nginx-on-ubuntu/</a></p>
<p>Two small changes:</p>
<p><code>PHP_FCGI_CHILDREN=5<br />
sbin/start-stop-daemon --quiet --start ....</code></p>
<p>running PHP_FCGI_CHILDREN at 15 causes the server to overload, but running 5 seems to work fine. Also, the start-stop-daemon is inside the sbin.</p>
<p>Been running this blog and four other sites on this setup for about a week now. It is way snappier than before on Apache.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/php/vinh-pham-%c2%bb-slicehost-setup-ubuntu-nginx-php-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JTable + MySQL &#8211; Java</title>
		<link>http://blog.theunical.com/java/jtable-mysql-java/</link>
		<comments>http://blog.theunical.com/java/jtable-mysql-java/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 02:47:52 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[MySQL 5.1]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MySql 5.0]]></category>
		<category><![CDATA[Springs]]></category>
		<category><![CDATA[JTable]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/databases/mysql/jtable-mysql-java/</guid>
		<description><![CDATA[JTable + MySQL Java. &#8230; JTable + MySQL. 7 Hours Ago. If in big problem, I want a to add the ResultSet of MySQL in JTable.Table should in Panel. and There should be autosizing of the result. It&#8217;s a very common requirement, and there are a number of good sample solutions on the web (basically [...]]]></description>
			<content:encoded><![CDATA[<p>JTable + <strong>MySQL</strong> Java. <strong>&#8230;</strong> JTable + <strong>MySQL</strong>. 7 Hours Ago. If in big problem, I want a to add the ResultSet of <strong>MySQL</strong> in JTable.Table should in Panel. and There should be autosizing of the result.</p>
<p>It&#8217;s a very common requirement, and there are a number of good sample solutions on the web (basically you have to loop down the whole column to find the widest entry, then use that size to set the column width).<br />
You may find this useful:</p>
<div>
<div style="float: right; margin-right: 10px;"><a title="Help with Code Tags" href="http://www.daniweb.com/forums/misc-explaincode.html?TB_iframe=true&amp;height=400&amp;width=680" target="_blank">Help with Code Tags</a></div>
<div><strong>JAVA Syntax</strong> (<a onclick="toggle('code2031333909'); return false;" href="http://www.daniweb.com/forums/thread226106.html#">Toggle Plain Text</a>)</div>
</div>
<div id="code2031333909_1">
<pre>
<ol>
<li>
<div><span>public</span> <span>void</span> packColumns<span>(</span><span>JTable</span> table<span>)</span> <span>{</span></div>
</li>
<li>
<div>	<span>DefaultTableColumnModel</span> colModel = <span>(</span><span>DefaultTableColumnModel</span><span>)</span> table</div>
</li>
<li>
<div>			.<span>getColumnModel</span><span>(</span><span>)</span>;</div>
</li>
<li>
<div>	<span>for</span> <span>(</span><span>int</span> cNumber = <span>0</span>; cNumber &lt; table.<span>getColumnCount</span><span>(</span><span>)</span>; cNumber++<span>)</span> <span>{</span></div>
</li>
<li>
<div>		<span>TableColumn</span> col = colModel.<span>getColumn</span><span>(</span>cNumber<span>)</span>;</div>
</li>
<li>
<div>		<span>int</span> width = <span>0</span>;</div>
</li>
<li>
<div>		<span>// Get width of column header</span></div>
</li>
<li>
<div>		<span>TableCellRenderer</span> renderer = col.<span>getHeaderRenderer</span><span>(</span><span>)</span>;</div>
</li>
<li>
<div>		<span>if</span> <span>(</span>renderer == <span>null</span><span>)</span> <span>{</span></div>
</li>
<li>
<div>			renderer = table.<span>getTableHeader</span><span>(</span><span>)</span>.<span>getDefaultRenderer</span><span>(</span><span>)</span>;</div>
</li>
<li>
<div>		<span>}</span></div>
</li>
<li>
<div>		<span>Component</span> comp = renderer.<span>getTableCellRendererComponent</span><span>(</span>table, col</div>
</li>
<li>
<div>				.<span>getHeaderValue</span><span>(</span><span>)</span>, <span>false</span>, <span>false</span>, <span>0</span>, <span>0</span><span>)</span>;</div>
</li>
<li>
<div>		width = comp.<span>getPreferredSize</span><span>(</span><span>)</span>.<span>width</span>;</div>
</li>
<li>
<div>		<span>// Get maximum width of column data</span></div>
</li>
<li>
<div>		<span>for</span> <span>(</span><span>int</span> r = <span>0</span>; r &lt; table.<span>getRowCount</span><span>(</span><span>)</span>; r++<span>)</span> <span>{</span></div>
</li>
<li>
<div>			renderer = table.<span>getCellRenderer</span><span>(</span>r, cNumber<span>)</span>;</div>
</li>
<li>
<div>			comp = renderer.<span>getTableCellRendererComponent</span><span>(</span>table, table</div>
</li>
<li>
<div>					.<span>getValueAt</span><span>(</span>r, cNumber<span>)</span>, <span>false</span>, <span>false</span>, r, cNumber<span>)</span>;</div>
</li>
<li>
<div>			width = <span>Math</span>.<span>max</span><span>(</span>width, comp.<span>getPreferredSize</span><span>(</span><span>)</span>.<span>width</span><span>)</span>;</div>
</li>
<li>
<div>		<span>}</span></div>
</li>
<li>
<div>		col.<span>setPreferredWidth</span><span>(</span>width + <span>2</span><span>)</span>;  <span>// Add margin</span></div>
</li>
<li>
<div>	<span>}</span></div>
</li>
<li>
<div><span>}</span></div>
</li>
</ol>
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/java/jtable-mysql-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Ajax Table Editor &#124; Squico</title>
		<link>http://blog.theunical.com/javascript/mysql-ajax-table-editor-squico/</link>
		<comments>http://blog.theunical.com/javascript/mysql-ajax-table-editor-squico/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 23:20:13 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL 5.1]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MySql 5.0]]></category>
		<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/javascript/mysql-ajax-table-editor-squico/</guid>
		<description><![CDATA[Mysql Ajax Table Editor is a very versatile and customizable mysql editor. It is PHP4 and PHP5 compatible and it has incredible join capabilities. This mysql editor has the ability to join on multiple tables and maintain search functionality and best of all it is written with ajax. This makes the script very dynamic and [...]]]></description>
			<content:encoded><![CDATA[<p>Mysql Ajax Table Editor is a very versatile and customizable mysql editor. It is PHP4 and PHP5 compatible and it has incredible join capabilities. This mysql editor has the ability to join on multiple tables and maintain search functionality and best of all it is written with ajax. This makes the script very dynamic and it can be customized to fit almost every application. Things like dynamic forms and user defined actions make it very powerful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/javascript/mysql-ajax-table-editor-squico/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Download MySQL 5.1.39</title>
		<link>http://blog.theunical.com/databases/mysql/download-mysql-5-1-39-filehippo-com/</link>
		<comments>http://blog.theunical.com/databases/mysql/download-mysql-5-1-39-filehippo-com/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 19:44:06 +0000</pubDate>
		<dc:creator>Steven Wall</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[MySQL 5.1]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MySql 5.0]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/databases/mysql/download-mysql-5-1-39-filehippo-com/</guid>
		<description><![CDATA[MySQL Community Edition is a freely downloadable version of the world&#8217;s most popular open source database that is supported by an active community of open source developers and enthusiasts. MySQL delivers enterprise features, including: Partitioning to improve performance and management of very large database environments Row-based/Hybrid Replication for improved replication security Event Scheduler to create [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>MySQL Community Edition is a freely downloadable version of the world&#8217;s most popular open source database that is supported by an active community of open source developers and enthusiasts.</p>
<p>MySQL delivers enterprise features, including:</p>
<ul>
<li>Partitioning to improve performance and management of very large database environments</li>
<li>Row-based/Hybrid Replication for improved replication security</li>
<li>Event Scheduler to create and schedule jobs that perform various database tasks</li>
<li>XPath Support</li>
<li>Dynamic General/Slow Query Log</li>
<li>Performance/Load Testing Utility (mysqlslap)</li>
<li>Improved! Full Text Search (faster, new dev templates)</li>
<li>Improved! Archive engine (better compression, more features)</li>
<li>Improved! User session and problem SQL identification</li>
<li>Improved! MySQL embedded library (libmysqld)</li>
<li>Additional INFORMATION_SCHEMA objects</li>
<li>Faster data import operations (parallel file load)</li>
<li>ACID Transactions to build reliable and secure business critical applications</li>
<li>Stored Procedures to improve developer productivity</li>
<li>Triggers to enforce complex business rules at the database level</li>
<li>Views to ensure sensitive information is not compromised</li>
<li>Information Schema to provide easy access to metadata</li>
<li>Pluggable Storage Engine Architecture for maximum flexibility</li>
<li>Archive Storage Engine for historical and audit data</li>
</ul>
<p><a href="http://www.filehippo.com/download_mysql/download/93f146a7b3a9de8b538ba5a910518e57/"><img src="http://cache.filehippo.com/img/down5.png" alt="Download" /></a><a href="http://www.filehippo.com/download_mysql/download/93f146a7b3a9de8b538ba5a910518e57/"><strong>Download<br />
This Version</strong></a><br />
<strong>39.00MB</strong></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/databases/mysql/download-mysql-5-1-39-filehippo-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

