Mysql Real Escape String PHP Function Adding "\" to My Field Entry
Posted
by Jascha
on Stack Overflow
See other posts from Stack Overflow
or by Jascha
Published on 2010-02-17T20:23:07Z
Indexed on
2010/03/14
4:55 UTC
Read the original article
Hit count: 399
Hello,
I am submitting a form to my mySql database using PHP.
I am sending the form data through the
mysql_real_escape_string($content);
function.
When the entry shows up in my database (checking in myPhpAdmin) all of my double quotes and single quotes are escaped.
I'm fairly certain this is a PHP configuration issue?
so:
$content = 'Hi, my name is Jascha and my "favorite" thing to do is sleep';
mysql_real_escape_string($content);
$query = 'INSERT INTO DB...'
comes up in my database as:
Hi, my name is Jascha and my \"favorite" thing to do is sleep
Who do I tell what to do? (I cannot access the php.ini).
-J
© Stack Overflow or respective owner