<?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>Jess Barnes &#187; MySQL</title>
	<atom:link href="http://jessbarnes.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://jessbarnes.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 17 Aug 2010 09:54:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>MySQL string escaping in PHP</title>
		<link>http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/</link>
		<comments>http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:44:21 +0000</pubDate>
		<dc:creator>Jess Barnes</dc:creator>
				<category><![CDATA[Code Stuff]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jessbarnes.com/?p=47</guid>
		<description><![CDATA[Simple function to prepare user inputted data for inserting into a MySQL database. It simply checks if stripslashes() should be called, and then escapes the string. Basic, but handy. function mysql_escape($string) { if (get_magic_quotes_gpc() == 1) { $string = stripslashes($string); } $string = mysql_real_escape_string($string); return $string; } Related posts:PHP function to generate a slug for [...]


Related posts:<ol><li><a href='http://jessbarnes.com/2010/03/php-function-to-generate-a-slug-for-seo-urls/' rel='bookmark' title='Permanent Link: PHP function to generate a slug for SEO URLs'>PHP function to generate a slug for SEO URLs</a></li>
<li><a href='http://jessbarnes.com/2009/12/bash-alias-to-search-file-contents/' rel='bookmark' title='Permanent Link: Bash alias to search file contents'>Bash alias to search file contents</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Simple function to prepare user inputted data for inserting into a MySQL database. It simply checks if <code>stripslashes()</code> should be called, and then escapes the string. Basic, but handy.</p>
<pre class="brush: php;">
function mysql_escape($string) {
    if (get_magic_quotes_gpc() == 1) {
        $string = stripslashes($string);
    }
    $string = mysql_real_escape_string($string);
    return $string;
}
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://jessbarnes.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>Related posts:<ol><li><a href='http://jessbarnes.com/2010/03/php-function-to-generate-a-slug-for-seo-urls/' rel='bookmark' title='Permanent Link: PHP function to generate a slug for SEO URLs'>PHP function to generate a slug for SEO URLs</a></li>
<li><a href='http://jessbarnes.com/2009/12/bash-alias-to-search-file-contents/' rel='bookmark' title='Permanent Link: Bash alias to search file contents'>Bash alias to search file contents</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://jessbarnes.com/2009/12/mysql-string-escaping-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
