Re: Problem with mysql_real_escape_string

From: Date: Thu, 05 Mar 2009 20:29:51 +0000
Subject: Re: Problem with mysql_real_escape_string
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-289396@lists.php.net to get a copy of this message
On 05/03/09, Eric Butera wrote:
Make sure to always pass your active database connection into the second parameter of mysql_real_escape_string. There could be character set differences between your two servers too that might be causing issues for you. If at all possible I would recommend upgrading to mysqli or pdo and use prepared statements.
Thanks for the replies. I've reworked the database code to use PDO prepared statements and it works perfectly on the local and remote versions. Thanks! Nigel

« previous php.general (#289396) next »