PHP mysqli_get_host_info() Function

The mysqli_get_host_info() function returns the MySQL server hostname and the connection type.

Object oriented style

string $mysqli->host_info;

Procedural style

string mysqli_get_host_info ( mysqli $link )

Returns a string describing the connection represented by the link parameter (including the server host name).

Examples -

Object oriented style

Procedural style

The above examples will output:

Host info: Localhost via UNIX socket

ParameterDescription
linkProcedural style only: A link identifier returned by mysqli_connect() or mysqli_init()

A character string representing the server hostname and the connection type.