mysqli::$server_info
PHP function
Edit on GitHub ✎
Returns the version of the MySQL server
Description
Oop
stringmysqli->server_info
mysqli::get_server_info(): string
Procedural
mysqli_get_server_info(mysqli $mysql): string
Returns a string representing the version of the MySQL server that the MySQLi extension is connected to.
Parameters
Return Values
A character string representing the server version.
Examples
$mysqli->server_info example
Oop
php
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli("localhost", "my_user", "my_password");
/* print server version */
printf("Server version: %s\n", $mysqli->server_info);Procedural
php
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "my_user", "my_password");
/* print server version */
printf("Server version: %s\n", mysqli_get_server_info($link));Similar
output
Server version: 8.0.21