#31418 [NEW]: MySQL connection functions do Not Work With Double Quotes on Argument

From: Date: Wed, 05 Jan 2005 15:46:38 +0000
Subject: #31418 [NEW]: MySQL connection functions do Not Work With Double Quotes on Argument
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969365829@lists.php.net to get a copy of this message
From: sam dot boles at acfb dot org Operating system: Windows 2000 PHP version: 5.0.3 PHP Bug Type: Documentation problem Bug description: MySQL connection functions do Not Work With Double Quotes on Argument Description: ------------ Issue Environment: Apache/2.0.52 (Win32) PHP/5.0.3 MySQL client API version 4.1.7 MySQL version 4.1.7 -nt Windows 2000 Server Service Pack 4 When trying to connect to MySQL database using either mysql or mysqli extensions, the server throws this error: Error 1045:Access denied for user 'user_name'@'host_name' (using password:YES). (user_name and host_name in the previous error are actual user and host name in the real error message--these names have been changed to protect the innocent.) This error occurs when connecting via PHP, does not occur when using other MySQL clients. Almost all of the online documentation and examples I found use a syntax with double quotes on the arugments to the connection functions. {$mysqli = new mysqli("host_name","user_name", "password", "database");} It is this double quote syntax seems to be what caused the function not to work in above named environment. As far as I can tell, there are no escape characters or variable interpolations in the actual username, password or databse, so I don't belive that is the issue. Notwithstanding, changing the function arguments to single quotes {$mysqli = new mysqli('host_name' , 'user_name', 'password', 'database');} seems to work perfectly. I have tested this pattern and it is very consistent--double quoted arguments will not work, single quoted arguments function smoothly. A mention of this in the docs or online resources would be helpful. This may be something unique to this configuration, or to my environment. Also, if I am just blind and missed a mention of this in the documentation, please forgive. -- Edit bug report at http://bugs.php.net/?id=31418&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31418&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31418&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31418&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31418&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31418&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31418&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31418&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31418&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31418&r=support Expected behavior: http://bugs.php.net/fix.php?id=31418&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31418&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31418&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31418&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31418&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31418&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31418&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31418&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31418&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31418&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31418&r=mysqlcfg

« previous php.doc (#969365829) next »