Forum und email

mysql_get_host_info

(PHP 4 >= 4.0.5, PHP 5, PECL mysql:1.0)

mysql_get_host_info — Obtener información de la máquina anfitriona MySQL

Descripción

string mysql_get_host_info ([ resource $id_enlace ] )

Describe el tipo de conexión en uso, incluyendo el nombre del equipo servidor anfitrión.

Lista de 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 by chance no connection is found or established, an E_WARNING level warning is generated.

Valores retornados

Devuelve una cadena que describe el tipo de conexión MySQL en uso, o FALSE si ocurre un error.

Ejemplos

Example#1 Ejemplo de mysql_get_host_info()

<?php
$enlace 
mysql_connect("localhost""mysql_user""mysql_password");
if (!
$enlace) {
    die(
"No pudo conectarse: " mysql_error());
}
printf("Informaci&oacute;n del host MySQL: %s\n"mysql_get_host_info());
?>

El resultado del ejemplo seria algo similar a:

Informaci&oacute;n del equipo anfitri&oacute;n MySQL: Localhost via UNIX socket