[Phpmyadmin-devel] mysqli.dbi.lib.php proposed change

Marc Delisle DelislMa at CollegeSherbrooke.qc.ca
Sat Jun 5 09:58:01 CEST 2004


Hi,

I am trying to use mysqli with the default socket:
$cfg['Servers'][$i]['socket']       = '';

and I cannot make it work. I am currently using MySQL 4.1.1.

The last parameter $server_socket in

$link = @mysqli_connect($cfg['Server']['host'], $user, $password, FALSE, 
$server_port, $server_socket);

can contain the real socket as asked in the config, or FALSE.
If FALSE or '', the connection to the default socket does not work.

However, it works if no parameter is passed:

$link = @mysqli_connect($cfg['Server']['host'], $user, $password, FALSE, 
$server_port);

So I suggest to make the presence of this last parameter conditional.
Maybe like this:

if ($server_socket) {
	$link = @mysqli_connect($cfg['Server']['host'], $user, $password, 
FALSE, $server_port, $server_socket);
} else {
	$link = @mysqli_connect($cfg['Server']['host'], $user, $password, 
FALSE, $server_port);

}


Marc




More information about the Developers mailing list