note 12872 deleted from function.mysql-query by jimw

From: Date: Sat, 08 Dec 2001 22:20:31 +0000
Subject: note 12872 deleted from function.mysql-query by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22290@lists.php.net to get a copy of this message
If you have any single quotes in variables you are inserting into a mysql database, then in PHP3 you need to use addslashes() to escape them to \' PHP4 does this automatically, which can cause slashes to remain in the database if you manually addslashes(). To solve this, either don't use addslashes() or use stripslashes() on when you get the data out of the database. Be careful using the stripslashes() method, as you could end up removing back slashes that are actually part of the data.

« previous php.notes (#22290) next »