ID: 38998 Updated by: [EMAIL PROTECTED] Reported By: camka at email dot ee -Status: Open +Status: Assigned Bug Type: MySQLi related Operating System: win 2000 PHP Version: 5.1.6 -Assigned To: +Assigned To: georg New Comment:
Assigned to the maintainer. Previous Comments: ------------------------------------------------------------------------ [2006-10-02 09:04:02] camka at email dot ee This does not describe, why the first case does not give an error at all, even if the host is not reachable or does not exist: $m = mysqli(); // with no parameters ------------------------------------------------------------------------ [2006-10-02 08:54:51] [EMAIL PROTECTED] NULL values passed as parameter to mysqli::__construct() have a special meaning, which are described in the docs. ------------------------------------------------------------------------ [2006-09-29 22:42:06] camka at email dot ee Description: ------------ If passing NULL parameters in mysqli::__construct, as they are by default, the values are not actually taken from php.ini (or apache conf) file. Tested with both 5.1.6 and 5.2 latest snapshot. Reproduce code: --------------- virtual host conf: php_admin_value "mysqli.default_host" zorro php_admin_value "mysqli.default_user" rootf php_admin_value "mysqli.default_pw" ff <? $m = new mysqli(); echo mysqli_connect_error(), "\n"; $m = new mysqli(null); echo mysqli_connect_error(), "\n"; $m = new mysqli(null, null); echo mysqli_connect_error(), "\n"; $m = new mysqli(null, null, null); echo mysqli_connect_error(), "\n"; ?> Expected result: ---------------- Access denied for user 'rootf'@'zorro' (using password: YES) Access denied for user 'rootf'@'zorro' (using password: YES) Access denied for user 'rootf'@'zorro' (using password: YES) Access denied for user 'rootf'@'zorro' (using password: YES) Actual result: -------------- [empty] Access denied for user 'rootf'@'localhost' (using password: YES) Access denied for user 'ODBC'@'localhost' (using password: YES) Access denied for user 'ODBC'@'localhost' (using password: NO) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38998&edit=1