Reputation: 87
I have some question about saving html code in mysql database every time when I put the charter " ' " in the database it changes to " / ".
Example: somthing like that
<p>That's my name</p>
After saving it look like this:
<p>That\'s my name</p>
what can i do? thank u all
Upvotes: 1
Views: 9470
Reputation: 4506
You are using addslashes like escape functions in your code.
addslashes()
— Quote string with slashes - http://php.net/manual/en/function.addslashes.php
stripslashes()
— Un-quotes a quoted string - http://php.net/manual/en/function.stripslashes.php
Upvotes: 2
Reputation: 456
Use stripslashes to remove '\' from HTML data. Actually (') is used define string in MySql, so it ecaspe it (by putting \ in-front) in order to avoid any unintentional use.
Upvotes: 0
Reputation: 943470
mysql_real_escape_string
addslashes
Upvotes: 5