turn of magic quotes or test for it before using addslashes
Bastien
From: Petzo [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] addslashes + stripslashes + mysql question
Date: Mon, 16 May 2005 11:20:41 +0300
Hi,
My question is about the norlmal behaviour of PHP and MYSQL but
You have the string ' \
With addslashes it becomes '\ \\
When you insert it into the database
it goes into a query like this
update table set field=' '\ \\ '
But that inserts into the field only ' \ ,
in other words the original string.
It is a normal behaviour and you should
omit the
you might want to check to see if magic quotes GPC is turned on, if it is
then you are adding slashes twice. You can either turn it off or do not use
addslashes ;)
--
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
You have the string ' \
With addslashes it becomes '\ \\
When you insert it into the database
it goes into a query like this
update table set field=' '\ \\ '
But that inserts into the field only ' \ ,
in other words the original string.
It is a normal behaviour and you should
omit the
[EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Monday, May 16, 2005 4:09 PM
Subject: Re: [PHP-DB] addslashes + stripslashes + mysql question
You have the string ' \
With addslashes it becomes '\ \\
When you insert it into the database
it goes into a query like this
update table set field