PHP mysqli_get_server_info() function returns the version of the MySQL server.
Syntax
string mysqli_get_server_info(connection);
Parameter | Description |
---|---|
Connection : | Required parameter. The MySQL connection to be used. |
Return Values : | Returns a character string representing the server version. |
<?php $con = mysqli_get_charset("localhost","user","password","db"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Get version of the MySQL server echo mysqli_get_server_info($con); mysqli_close($con); ?>