Return the MySQL server version:
<?php$con=mysqli_connect("localhost","my_user","my_password","my_db");//Detect connection if (mysqli_connect_errno($con)) { echo "Database connection failed: " . mysqli_connect_error(); }echo mysqli_get_server_info($con);mysqli_close($con);?>The mysqli_get_server_info() function returns the MySQL server version.
mysqli_get_server_info( connection ) ;
parameter | describe |
---|---|
connection | Required. Specifies the MySQL connection to use. |
Return value: | Returns a string representing the MySQL server version. |
---|---|
PHP version: | 5+ |