|
Posted by Matt Madrid on 08/05/07 06:38
zach wrote:
> Ok, something that confuses me is why does mysql_real_escape_string need
> a link or connection to the database if its simply escaping a string. I
> thought the whole point was to do the work before it ever goes to a
> database, so I wouldn't expect it to need a connection.
The documentation at: http://www.php.net/manual/en/function.mysql-real-escape-string.php
says: "mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string"
.... and the documentation at: http://dev.mysql.com/doc/refman/5.0/en/mysql-real-escape-string.html
says: "must be a valid, open connection. This is needed because the escaping depends on the
character set in use by the server."
The php documentation also says: "If no such link is found, it will try to create one as if
mysql_connect() was called with no arguments."
RTFM... ;-)
Navigation:
[Reply to this message]
|