Re: storing single and double quote in MySQL

From: Date: Mon, 22 May 2006 20:05:26 +0000
Subject: Re: storing single and double quote in MySQL
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-236662@lists.php.net to get a copy of this message
Richard Lynch wrote:
On Mon, May 22, 2006 11:37 am, Brad Bonkoski wrote:
http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users.
If you are using http://php.net/stripslashes on data coming out of your database, you are DEFINITELY doing something wrong acquiring that data. Stripslashes is "correctly" used ONLY when: 1. You have Magic Quotes on, and 2. You need to display/use the incoming data for something other than MySQL in the same script that does the INSERT Even then, you really ought to turn off Magic Quotes and migrate to http://php.net/mysql_real_escape_string Thanks for your constructive criticism.... Sorry for the original bad advice.
So, when the magic_quotes goes away in future version, with stripslashes() also go away? -Brad

« previous php.general (#236662) next »