|
Posted by Kim Andrι Akerψ on 10/11/06 11:14
comp.lang.php wrote:
> when trying to use the mysql_real_escape_string() function, the
> following warning occurs:
>
> [quote]
> Warning: mysql_real_escape_string()
> [function.mysql-real-escape-string]: Access denied for user
> 'web'@'localhost' (using password: NO) in
> /home/me/web/include/secondary/app_action.inc.php on line 337
>
> Warning: mysql_real_escape_string()
> [function.mysql-real-escape-string]: A link to the server could not be
> established in /home/me/web/include/secondary/app_action.inc.php on
> line 337
> [/quote]
>
> First of all, the user is not 'web' trying to connect to the database,
> secondly, what is mysql_real_escape_string() doing connecting to the
> database, as 'web' or anyone else, and thirdly, why is this happening,
> does anyone know?
>
> Thanx
> Phil
Have you connected to your MySQL database yet?
From the manual:
-----------------------------
Escapes special characters in the unescaped_string, taking into account
the current character set of the connection so that it is safe to place
it in a mysql_query(). If binary data is to be inserted, this function
must be used.
-----------------------------
Note: A MySQL connection is required before using
mysql_real_escape_string() otherwise an error of level E_WARNING is
generated, and FALSE is returned. If link_identifier isn't defined, the
last MySQL connection is used.
-----------------------------
--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
[Back to original message]
|