<p>I just moved to a new hosting company and now whenever a string gets escaped using:</p>
<pre><code>mysql_real_escape_string($str);
</code></pre>
<p>the slashes remain in the database. This is the first time I've ever seen this happen so none of my scripts use</p>
<pre><code>stripslashes()
</code></pre>
<p>anymore.</p>
<p>This is on a CentOS 4.5 64bit running php 5.2.6 as fastcgi on a lighttpd 1.4 server. I've ensured that all magic_quotes options are off and the mysql client api is 5.0.51a.</p>
<p>I have the same issue on all 6 of my webservers.</p>
<p>Any help would be appreciated.</p>
<p>Thanks.</p>
<h3>Edit:</h3>
<h3>Magic Quotes isn't on. Please don't recommend turning it off. THIS IS NOT THE ISSUE.</h3>

```
mysql_real_escape_string($str);
```
is supposed to do exactly that. it is meant to add backslashes to special characters especially when you want to pass the query to mysql. Take note that it also takes into account the character set of mysql.
For safer coding practices it would be good to edit your code and use
```
stripslashes()
```
to read out the data and remove the slashes.