ID: 33700 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: WinXP PHP Version: Irrelevant New Comment:
It's the same as with any other MySQL function. If no link_identifier is provided and no link does exist, connection is tried to establish with default user/password defined in php.ini. If this fails, mysql_real_escape_string() really generates WARNING and returns FALSE. I documented that in CVS at ref.mysql instead: "Most MySQL functions accept link_identifier as the last optional parameter. If it is not provided, last opened connection is used. If it doesn't exist, connection is tried to establish with default parameters defined in php.ini. If it is not successful, functions return FALSE." Previous Comments: ------------------------------------------------------------------------ [2005-07-14 17:54:36] [EMAIL PROTECTED] Description: ------------ mysql_real_ecape_string does not require a mysql connection. That makes the first note wrong: "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." This function doesn't generate a WARNING and doesn't return FALSE when no connexion is available. I don't know when this behavior changed so I'm unable to provide a patch, sorry. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33700&edit=1