Re: mysql_real_escape_string()

From: Date: Tue, 13 Nov 2007 04:20:05 +0000
Subject: Re: mysql_real_escape_string()
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44341@lists.php.net to get a copy of this message
My actual question is this line of code: $other = mysql_real_escape_string($other); is giving me this error message: Warning: mysql_real_escape_string(): Access denied for user 'nobody'@'localhost' (using password: NO) in /path/to/file/file.php on line 148 Warning: mysql_real_escape_string(): A link to the server could not be established in /path/to/file/file.php on line 148
You need to connect to the database before you can use mysql_real_escape_string so it can work out database encoding etc.
Where the previous server didn't require this I am wondering if there is a line I may add to my .htaccess to by-pass this requirement. My concern is that if I don't find all the instances I will have errors on my site ... this is extensive to correct.
You could try using auto_prepend_file (see http://www.php.net/manual/en/ini.core.php). -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#44341) next »