Introduction

We are describing the MySQL functions: mysql_get_client_info, mysql_get_client_version and mysql_get_host_info functions.

mysql_get_client_info

The "mysql_get_client_info()" function gets the MySQL client information.

Syntax

The syntax of mysql_get_client_info is:

string mysql_get_client_info ( void );

Example

<?php

//print the client library version

echo "MySQL client info: %s\n", mysql_get_client_info());

?>

Output

Mysql_get_client_info-in-php.jpg

mysql_get_client_version

The "mysql_get_client_version()" function returns the client version number as an integer.

Syntax

int mysqli_get_client_version ( mysqli $link );


Example

<?php

printf("Client library version: %d\n", mysqli_get_client_version());

?>

Output

Mysql_get_client_version-in-php.jpg

Example for Server information

<?php

$mysqli = new mysqli("localhost", "root", "");

/* check connection */

if (mysqli_connect_errno()) {

printf("Connect failed: %s\n", mysqli_connect_error());

exit();

}

/* print server version */

printf("Server version: %s\n", $mysqli->server_info);

/* close connection */

$mysqli->close();

?>

Output

Mysql_get_server_version-in-php.jpg

mysql_get_host_info

This "mysql_get_host_info()" function gets information about the MySQL host.

Syntax

The syntax of mysql_get_host_info is:

string mysql_get_host_info ( ( [resource_link_identifier]) );

Example

<?php

//print the server host information

printf("MySQL host info: %s\n", mysql_get_host_info());

?>

Output

Mysql_get_host_info-in-php.jpg