Query: mysqli_get_host_info
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MYSQLI_GET_HOST_INFO(3) 1 MYSQLI_GET_HOST_INFO(3) mysqli::$host_info - Returns a string representing the type of connection used Object oriented styleSYNOPSISstring$mysqli->host_info ()DESCRIPTIONProcedural style string mysqli_get_host_info (mysqli $link) Returns a string describing the connection represented by the $link parameter (including the server host name).PARAMETERSo $ link -Procedural style only: A link identifier returned by mysqli_connect(3) or mysqli_init(3)RETURN VALUESA character string representing the server hostname and the connection type.EXAMPLESExample #1 $mysqli->host_info example Object oriented style <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } /* print host information */ printf("Host info: %s ", $mysqli->host_info); /* close connection */ $mysqli->close(); ?> Procedural style <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } /* print host information */ printf("Host info: %s ", mysqli_get_host_info($link)); /* close connection */ mysqli_close($link); ?> The above examples will output: Host info: Localhost via UNIX socketSEE ALSOmysqli_get_proto_info(3). PHP Documentation Group MYSQLI_GET_HOST_INFO(3)
Related Man Pages |
---|
mysqli_autocommit(3) - php |
mysqli_error_list(3) - php |
mysqli_get_server_info(3) - php |
mysqli_multi_query(3) - php |
mysqli_ping(3) - php |
Similar Topics in the Unix Linux Community |
---|
Problems with file descriptor |
Pronounciation Help |
String Constant C |