<?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>RubberNeck Designs &#187; MySQL</title>
	<atom:link href="http://www.rubberneckdesigns.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubberneckdesigns.com</link>
	<description>Drupal Web Developer Notes &#38; Sharing</description>
	<lastBuildDate>Tue, 31 Jan 2012 00:28:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP and MySQL command line with MAMP on OSX</title>
		<link>http://www.rubberneckdesigns.com/mamp/php-and-mysql-command-line-with-mamp-on-osx/</link>
		<comments>http://www.rubberneckdesigns.com/mamp/php-and-mysql-command-line-with-mamp-on-osx/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 14:31:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[UNIX / LINIX]]></category>

		<guid isPermaLink="false">http://www.rubberneckdesigns.com/?p=434</guid>
		<description><![CDATA[I found a handy article named &#8220;Getting command line access to PHP and MySQL running MAMP on OSX&#8221; by  Joaquin Lippincott . It was very helpful for getting PHP and MySQL acces from the terminal on a mac. In addition, one of the comments by Matthew Bacon was about getting the ZEND FRAMWORK up and running [...]]]></description>
			<content:encoded><![CDATA[<p>I found a handy article named</p>
<p>&#8220;<a title="PHP and MySQL command line with MAMP on OSX" href="http://www.metaltoad.com/blog/getting-command-line-access-php-and-mysql-running-mamp-osx">Getting command line access to PHP and MySQL running MAMP on OSX</a>&#8221;</p>
<p>by  <a href="http://www.metaltoad.com/people/joaquin">Joaquin Lippincott .</a></p>
<p>It was very helpful for getting PHP and MySQL acces from the terminal on a mac.</p>
<p>In addition, one of the comments by Matthew Bacon was about getting the ZEND FRAMWORK up and running with the command line. I have copied it here for your convenience. I hope this helps someone.</p>
<p><span style="color: #666699;"><small> Posted by Matthew Bacon on <time datetime="2010-01-07T10:38:16-08:00" pubdate="pubdate">January 7, 2010. [<a href="http://www.metaltoad.com/comment/reply/71/457"><span style="color: #666699;">Reply</span></a>] </time></small></span></p>
<div>
<div>
<div>
<div>
<p><span style="color: #666699;">To anyone who is having problems getting Zend_Tool working on their MAC OS X (10.6) in Terminal, this is how to solve the problem.</span></p>
<p><span style="color: #666699;">Step 1</span><br />
<span style="color: #666699;"> &#8212;</span><br />
<span style="color: #666699;"> Download the Zend Framework to your downloads folder. Once downloaded, rename the folder ZendFramework</span></p>
<p><span style="color: #666699;">Step 2</span><br />
<span style="color: #666699;"> &#8212;</span><br />
<span style="color: #666699;"> Open Terminal and type: sudo cp -r ~/Downloads/ZendFramework /usr/local/ZendFrameworkCli</span></p>
<p><span style="color: #666699;">Step 3</span><br />
<span style="color: #666699;"> &#8212;</span><br />
<span style="color: #666699;"> In Terminal, type: open ~/.bash_profile</span></p>
<p><span style="color: #666699;">Note: If file is not found&#8230;</span><br />
<span style="color: #666699;"> &#8212;</span><br />
<span style="color: #666699;"> Open the application TextEdit. Create a new file and make sure you are typing in plain text only. Type the following: alias zf=/usr/local/ZendFrameworkCli/bin/zf.sh</span></p>
<p><span style="color: #666699;">Save and exit TextEdit</span></p>
<p><span style="color: #666699;">Step 4</span><br />
<span style="color: #666699;"> &#8212;</span><br />
<span style="color: #666699;"> In Terminal, type: zf show version</span></p>
<p><span style="color: #666699;">Done!</span></p>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/mamp/php-and-mysql-command-line-with-mamp-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL from the Command Line (terminal) in MAMP PRO</title>
		<link>http://www.rubberneckdesigns.com/mamp/mysql-from-the-command-line-terminal-in-mamp-pro/</link>
		<comments>http://www.rubberneckdesigns.com/mamp/mysql-from-the-command-line-terminal-in-mamp-pro/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 22:52:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[UNIX / LINIX]]></category>

		<guid isPermaLink="false">http://www.rubberneckdesigns.com/?p=425</guid>
		<description><![CDATA[To get to the command line for MySQL for MAMP or MAMP PRO just open up you terminal and enter the following:   /Applications/MAMP/Library/bin/mysql &#8211;host=localhost -uroot -proot You can see all the databases by using the following command: If you type the MySQL command : USE &#60;table name&#62;  you can then start using that particular [...]]]></description>
			<content:encoded><![CDATA[<p>To get to the command line for MySQL for MAMP or MAMP PRO just open up you terminal and enter the following:</p>
<address> </address>
<address>/Applications/MAMP/Library/bin/mysql &#8211;host=localhost -uroot -proot</address>
<p>You can see all the databases by using the following command:</p>
<p><a href="http://www.rubberneckdesigns.com/wp-content/uploads/2011/10/Screen-shot-2011-10-09-at-6.44.47-PM.png"><img class="alignnone size-full wp-image-427" title="mysql command line command SHOW DATABASES" src="http://www.rubberneckdesigns.com/wp-content/uploads/2011/10/Screen-shot-2011-10-09-at-6.44.47-PM.png" alt="mysql command line command show databases" width="244" height="403" /></a></p>
<p>If you type the MySQL command : USE &lt;table name&gt;  you can then start using that particular database.</p>
<p>Another convenient command is SHOW TABLES. Can you figure out what that does?</p>
<p>Now you can type MySQL commands right from the command line.</p>
<address> </address>
<address> </address>
<address> </address>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/mamp/mysql-from-the-command-line-terminal-in-mamp-pro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAMP: Dealing with HUGE MySQL Queries</title>
		<link>http://www.rubberneckdesigns.com/mamp/mamp-dealing-with-huge-mysql-queries/</link>
		<comments>http://www.rubberneckdesigns.com/mamp/mamp-dealing-with-huge-mysql-queries/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 23:37:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.rubberneckdesigns.com/?p=335</guid>
		<description><![CDATA[After importing a relativly huge table into my local dev using MAMP, I was experiencing MySQL hangups on large queries that when on a live site would be no problem. To fix this I made the following adjustments to the MAMP PRO my.cnf  file. The my.cnf file is edited in MAMP PRO pulldown menu by [...]]]></description>
			<content:encoded><![CDATA[<p>After importing a relativly huge table into my local dev using MAMP, I was experiencing MySQL hangups on large queries that when on a live site would be no problem.</p>
<p>To fix this I made the following adjustments to the MAMP PRO my.cnf  file.</p>
<p>The my.cnf file is edited in MAMP PRO pulldown menu by clicking on  FILE&gt;&gt;Edit Template&gt;&gt;MySQL my.cnf<br />
<img class="alignnone size-medium wp-image-334" title="MAMP my.cnf file edit" src="http://www.rubberneckdesigns.com/wp-content/uploads/2011/01/Screen-shot-2011-01-30-at-5.21.09-PM-300x126.jpg" alt="MAMP my.cnf file edit" width="300" height="126" /></p>
<p>Notice starting on line 30 (image below) that I made changes to buffer allowances and memory allowances etc.<br />
Basically just making everything bigger. I could hone this to the &#8220;best sizes&#8221; but really i don&#8217;t have time<br />
and this is just for my local dev so threw some pretty big numbers in there for plenty of elbow room. IF you have any suggestions or have optimized your my.cnf file please feel free to make a comment.</p>
<p><img class="alignnone size-full wp-image-336" title="Screen shot 2011-01-30 at 5.33.19 PM" src="http://www.rubberneckdesigns.com/wp-content/uploads/2011/01/Screen-shot-2011-01-30-at-5.33.19-PM.jpg" alt="Screen shot 2011-01-30 at 5.33.19 PM" width="417" height="407" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/mamp/mamp-dealing-with-huge-mysql-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import WordPress Database from Staging Server to Local Development Server</title>
		<link>http://www.rubberneckdesigns.com/mamp/import-wordpress-database-from-staging-server-to-local-development-server/</link>
		<comments>http://www.rubberneckdesigns.com/mamp/import-wordpress-database-from-staging-server-to-local-development-server/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 17:01:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.rubberneckdesigns.com/?p=317</guid>
		<description><![CDATA[You may be working with a WordPress project and wish to use SVN to have a development instance, a staging instance, a local development instance and of course a production instance of the web site. This could prove to be problematic in keeping track of your data base instances. WordPress stores the root URL (http://website.com) [...]]]></description>
			<content:encoded><![CDATA[<p>You may be working with a WordPress project and wish to use SVN to have a development instance, a staging instance, a local development instance and of course a production instance of the web site. This could prove to be problematic in keeping track of your data base instances. WordPress stores the root URL (http://website.com) at several places in their database. This can cause a problem when you try to import a copy of one of the live databases to your local development environment. When ever you click on a link it will send you to the live instance instead of remaining on your local environment. A way around this, for local development environment purposes, would be as follows:</p>
<ol>
<li>prior to importing the .sql file, open it in your favorite code editor. I like to use BB Edit.</li>
<li>Perform a search and replace on the .sql file for the root url.</li>
<li> ie:  search for &#8220;http://www.livestagingserver.com&#8221; and replace with &#8220;http://mylocaldev.me&#8221;</li>
<li>Save the file and import it into your local WordPress data base.</li>
</ol>
<p>Now whenever you click on your posts in your local development environment the links will stay within your local development environment.<br />
This way, you can keep a local copy of your database so you have a faster and more local way of working. This also serves to keep the live instance of the database from getting contaminated with the residual artifacts of development work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/mamp/import-wordpress-database-from-staging-server-to-local-development-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Navicat Connetion with MAMP Pro</title>
		<link>http://www.rubberneckdesigns.com/drupal-6-drupal-7/navicat-connetion-with-mamp-pro/</link>
		<comments>http://www.rubberneckdesigns.com/drupal-6-drupal-7/navicat-connetion-with-mamp-pro/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 16:43:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Drupal 6 & Drupal 7]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.rubberneckdesigns.com/?p=284</guid>
		<description><![CDATA[MAMP Pro has a lot of nice features. However, this means it changes things up a bit. How you make a connection with Navicat is one such example. So here is a quick helper post get Navicat up and running with MAMP PRo. 1) Add your information to the &#8220;Connection Properties&#8221; Pane as you normally [...]]]></description>
			<content:encoded><![CDATA[<p>MAMP Pro has a lot of nice features. However, this means it changes things up a bit. How you make a connection with Navicat is one such example. So here is a quick helper post get Navicat up and running with MAMP PRo.</p>
<p>1) Add your information to the &#8220;Connection Properties&#8221; Pane as you normally would.</p>
<p><img class="size-medium wp-image-286 alignnone" title="Navicat Pane -General" src="http://www.rubberneckdesigns.com/wp-content/uploads/2010/02/Screen-shot-2010-02-13-at-12.02.48-PM-300x270.jpg" alt="Navicat Pane -General" width="300" height="270" /></p>
<p>2) Click on the &#8220;Advanced&#8221; pane and check the box next to &#8220;Use socket for localhost connection.&#8221;</p>
<p>3) Then for the &#8220;Socket File Path&#8221; field type the following path.</p>
<p>/Applications/MAMP/tmp/mysql/mysql.sock</p>
<p>The &#8220;Advanced&#8221; Pane should now look like this:</p>
<p><img class="alignnone size-medium wp-image-287" title="Navicat Advanced Pane" src="http://www.rubberneckdesigns.com/wp-content/uploads/2010/02/Screen-shot-2010-02-13-at-12.09.26-PM-300x263.jpg" alt="Navicat Advanced Pane" width="300" height="263" /></p>
<p>Click &#8220;OK&#8221; and you should be all set.</p>
<p><img class="alignnone size-medium wp-image-289" title="Navicat Connection Sucessfull" src="http://www.rubberneckdesigns.com/wp-content/uploads/2010/02/Screen-shot-2010-02-13-at-12.11.35-PM-300x265.jpg" alt="Navicat Connection Sucessfull" width="300" height="265" /></p>
<p>I hope this helps. Please feel free to make comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/drupal-6-drupal-7/navicat-connetion-with-mamp-pro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Schema Data Structure Documentation in Drupal</title>
		<link>http://www.rubberneckdesigns.com/drupal-6-drupal-7/schema-data-structure-documentation-in-drupal/</link>
		<comments>http://www.rubberneckdesigns.com/drupal-6-drupal-7/schema-data-structure-documentation-in-drupal/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 23:06:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Drupal 6 & Drupal 7]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Drupal database scheme]]></category>
		<category><![CDATA[Drupal install file]]></category>
		<category><![CDATA[Drupal module install]]></category>

		<guid isPermaLink="false">http://rubberneckdesigns.com/?p=210</guid>
		<description><![CDATA[I have been working on a project on the Drupal 6 platform that requires the web application to recognize dynamically created sub-domains so the functionality of the database can be adjusted according to what sub-domain is in the current URL. To get Drupal 6 to do this, I am creating a custom module. One of [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on a project on the Drupal 6 platform that requires the web application to recognize dynamically created sub-domains so the functionality of the database can be adjusted according to what sub-domain is in the current URL.</p>
<p>To get Drupal 6 to do this, I am creating a custom module. One of the things I have learned about creating a custom module in Drupal 6 is the implementation of the module&#8217;s “install” file.</p>
<p>If you create a module named say,  my_module.module then the module&#8217;s install file name would be  my_module.install and will reside in the directory named my_module located at&#8230;.</p>
<p>my_site/sites/all/modules/my_module</p>
<p><a href="http://http://drupal.org/node/323314">Drupal 6 Module Install File Documentation</a></p>
<p>The  .install file will be run by Drupal 6 the 1st time my_module has been enabled. The my_module.install file will then be used to run setup procedures as stipulated by your module. The most common task for the my_module.install file to perform is creating database tables and fields. There is no special syntax for the install file. It is simply a PHP file with a .install extension to properly identify it to the Drupal 6 platform.</p>
<p>There is special function used in the .install file called hook_schema(). Where hook would be replaced by the name of your module. For example, if  the module you create is named my_module, then you would create a PHP file and name it my_module.install. Inside that file you will create a function named  my_module_schema(). The my_module_schema() function is used to create arrays representingthe database tables you wish the module to create in the Drupal database. You can see how this works here.</p>
<h3>Why do it this way?</h3>
<p>Once you build the Drupal API Schema there is no more need for  separate CREATE TABLE or ALTER TABLE statements on each database. As a module developer, you only need to create a schema structure and/or use the Drupal Schema API functions, and Drupal takes care of the rest. This greatly simplifies  writing install and update functions.</p>
<p>This way of creating the module install files also allows for support in multiple database platforms.</p>
<p>According to Drupal&#8217;s Blog this also allows for “Several advanced capabilities, such as incremental database updates, a simple and consistent CRUD API, form scaffolding, simpler CCK and Views, schema and data validation, become much easier to implement in future enhancements.”</p>
<p><a href="http://http://drupal.org/node/146866">Schema Data Structure Documentation by Drupal</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/drupal-6-drupal-7/schema-data-structure-documentation-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen shot of the up and comming CPI Data Panel</title>
		<link>http://www.rubberneckdesigns.com/ajax-web-design/screen-shot-of-the-up-and-comming-cpi-data-panel/</link>
		<comments>http://www.rubberneckdesigns.com/ajax-web-design/screen-shot-of-the-up-and-comming-cpi-data-panel/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 14:24:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://rubberneckdesigns.com/?p=147</guid>
		<description><![CDATA[I havn&#8217;t posted in few weeks because I have been very busy with several projects. One of the projects I am particularly excited about the CPI panel. The Cpi panel is new &#8220;back end&#8221; for LoveFineArt.com. IT used to be that each and every product would take about 20 minuets to enter. With this new [...]]]></description>
			<content:encoded><![CDATA[<p>I havn&#8217;t posted in few weeks because I have been very busy with several projects. One of the projects I am particularly excited about the CPI panel. The Cpi panel is new &#8220;back end&#8221; for LoveFineArt.com. IT used to be that each and every product would take about 20 minuets to enter. With this new panel (incorperating secure AJAX), The products can be entered as fast as the site owner can type!</p>
<p>Here is a screen shot of the new back end.</p>
<dl id="attachment_148" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><img class="size-medium wp-image-148" title="cpi_panel_screenshot_for_we" src="http://rubberneckdesigns.com/wp-content/uploads/2009/07/cpi_panel_screenshot_for_we-300x243.jpg" alt="Screen shot of the up and comming CPI Data Panel" width="300" height="243" /></dt>
</dl>
<p>I have also been busy learning the Drupal platform. AS I become more knowledgeable there will be posts and perhaps a special section on this blog devoted to cool new drupalistic methods and problem solving.</p>
<p>AS always, I invite you to leave a coment or sugestion or critisizm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/ajax-web-design/screen-shot-of-the-up-and-comming-cpi-data-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Protect Against SQL Injection</title>
		<link>http://www.rubberneckdesigns.com/ajax-web-design/how-to-protect-against-sql-injection/</link>
		<comments>http://www.rubberneckdesigns.com/ajax-web-design/how-to-protect-against-sql-injection/#comments</comments>
		<pubDate>Thu, 07 May 2009 23:44:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Security]]></category>

		<guid isPermaLink="false">http://rubberneckdesigns.com/?p=74</guid>
		<description><![CDATA[One of the most common web security problems is SQL Injection. As the name implies, SQL injections works by introducing malicious SQL code where it doesn&#8217;t belong. Since it is SQL code you could probably guess that the attacker &#8220;injects&#8221; his poison via database queries. Web developers often pass some sort of variable to their [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most common web security problems is SQL Injection. As the name implies, SQL injections works by introducing malicious SQL code where it doesn&#8217;t belong. Since it is SQL code you could probably guess that the attacker &#8220;injects&#8221; his poison via database queries. Web developers often pass some sort of variable to their database queries. Very common are variables that are influenced by user input. User input, to variable, then to query,- get it? So, there is a need for a way of eliminating the user&#8217;s ability to manipulate the variable in any way that could effect the query.</p>
<p><strong>What Happens With SQL Injection</strong></p>
<p>By passing an unexpected string of code into a user input, such a form, an attacker send damaging code that causes an otherwise good query to go haywire. For example:<span id="more-74"></span></p>
<div id="attachment_73" class="wp-caption alignleft" style="width: 384px"><img class="size-full wp-image-73" title="code snippet sql injection unprotected" src="http://www.rubberneckdesigns.com.php5-5.dfw1-2.websitetestlink.com/wp-content/uploads/2009/05/picture-8.png" alt="unprotected query is vulnerable" width="374" height="18" /><p class="wp-caption-text">unprotected query is vulnerable</p></div>
<p>The above snippet of code works as long as users put in the expected information. An attacker, will instead, make clever use of a few extra characters. You likely know by now that SQL requires a semi-colon at the end of each query. PHP automatically adds it in if you omit it. Because of this, the attacker, by closing the string and using the closing parenthesis to finish the query followed by a semi colon, can add an additional query to drop the table.<img class="size-full wp-image-75" title="example of SQL Injection" src="http://www.rubberneckdesigns.com.php5-5.dfw1-2.websitetestlink.com/wp-content/uploads/2009/05/picture-9.png" alt="example of SQL Injection" width="349" height="14" /></p>
<div class="mceTemp">
<dl id="attachment_75" class="wp-caption alignnone" style="width: 359px;">
<dd class="wp-caption-dd"><span style="color: #888888;">example of SQL Injection</span></dd>
</dl>
</div>
<p>This is what we in the world of secure web development refer to as a &#8216;bad thing&#8217;!<br />
Scary isn&#8217;t it? Attackers have used this method to not only drop tables and destroy records, but also to retrieve highly sensitive information.</p>
<p><strong>How to Protect Against SQL Injection</strong></p>
<p>OK, after that scary bit of information, you&#8217;ll be glad to know that protecting yourself is really not all that hard. The hard part is always remembering when and where to do it.</p>
<p>Protecting against SQL Injection is a simple matter of calling a PHP function that renders data safe ( or cleansed ) for use in a query. There are a few methods for cleansing user input in PHP depending on the PHP extension you are using. We will be discussing the mysql extension.The name of the function is:<br />
<span style="color: #0000ff;">mysql_real_escape_string()</span>. Notice in this snippet how it is used:</p>
<div id="attachment_72" class="wp-caption alignnone" style="width: 480px"><img class="size-full wp-image-72" title="code snippet mysql_real_escape_string" src="http://www.rubberneckdesigns.com.php5-5.dfw1-2.websitetestlink.com/wp-content/uploads/2009/05/picture-7.png" alt="How to protect again SQL Injection" width="470" height="205" /><p class="wp-caption-text">How to protect again SQL Injection</p></div>
<p>See how easy it is?  Just take the user input (in this case a post ) and pass it through the <span style="color: #0000ff;">mysql_real_escape_string()</span> function, (as shown on line 7 ). Then use the &#8220;cleansed&#8221; variable in the query ( as shown on line 9 ).</p>
<p>It is so easy to protect against this, yet it is often overlooked or forgotten. SO remember to use <span style="color: #0000ff;">mysql_real_escape_string()</span> to cleanse your input to help guard against SQL Injection.</p>
<p>There is more to learn and be discussed so feel free to stop back or drop me any suggestions or tips to share.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubberneckdesigns.com/ajax-web-design/how-to-protect-against-sql-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

