mysqli mysqli_connect ([ string $host = ini_get("mysqli.default_host") [, string $username = ini_get("mysqli.default_user") [, string $passwd = ini_get("mysqli.default_pw") [, string $dbname = "" [, int $port = ini_get("mysqli.default_port") [, string $socket = ini_get("mysqli.default_socket") ]]]]]] )
但是当我执行:
$dblink = new \mysqli($c['host'], $c['user'], $c['pass'], $c['name'], $c['port']);
它连接到默认端口。 只有在我做了这个之后
$dblink = new \mysqli($c['host'].":".$c['port'], $c['user'], $c['pass'], $c['name'], $c['port']);
它连接到了正确的端口吗。
$c['host'] == 'localhost'
是否成立? - axiac