You are here: Re: mysql_real_escape_string() « PHP Programming Language « IT news, forums, messages
Re: mysql_real_escape_string()

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация