Funções da MySQL
PHP Manual

mysql_get_host_info

(PHP 4 >= 4.0.5, PHP 5)

mysql_get_host_infoObtém informações do servidor MySQL

Descrição

string mysql_get_host_info ([ resource $link_identifier ] )

Descreve o tipo de conexão em uso para a conexão, incluindo o nome do servidor.

Parâmetros

link_identifier

The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If no connection is found or established, an E_WARNING level error is generated.

Valor Retornado

Retorna uma string descrevendo o tipo da conexão MySQL em uso para a conexão, ou FALSE em caso de falha.

Exemplos

Exemplo #1 Exemplo mysql_get_host_info()

<?php
$link 
mysql_connect('localhost''mysql_user''mysql_password');
if (!
$link) {
    die(
'Could not connect: ' mysql_error());
}
printf("MySQL host info: %s\n"mysql_get_host_info());
?>

O exemplo acima irá imprimir algo similar à:

MySQL host info: Localhost via UNIX socket

Veja Também


Funções da MySQL
PHP Manual