Forum und email

mysql_get_host_info

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

mysql_get_host_info — Get MySQL host info

Popis

string mysql_get_host_info ([ resource $link_identifier ] )

Describes the type of connection in use for the connection, including the server host name.

Parametre

link_identifier

Pripojenie k MySQL. Ak link identifier nie je zadaný, predpokladá sa posledné spojenie otvorené s mysql_connect(). Ak také spojenie nie je nájdené, pokúsi sa jedno vytvoriť ako keby bolo volané mysql_connect() bez argumentov. Ak sa náhodou nájde pripojenie, alebo je vytvorené, je vygenerované varovanie úrovne E_WARNING.

Vrátené hodnoty

Returns a string describing the type of MySQL connection in use for the connection or FALSE on failure.

Príklady

Example#1 mysql_get_host_info() example

<?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());
?>

Výstup horeuvedeného príkladu bude niečo podobné tomuto:

MySQL host info: Localhost via UNIX socket