Oracle 5.0 Reference Manual page 2404

Table of Contents

Advertisement

string
mysqli->server_info ;
Procedural style
string mysqli_get_server_info(
mysqli link);
Returns a string representing the version of the MySQL server that the MySQLi extension is connected
to.
Parameters
link
Return Values
A character string representing the server version.
Examples
Example 20.128.
$mysqli->server_info
Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password");
/* 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();
?>
Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
/* print server version */
printf("Server version: %s\n", mysqli_get_server_info($link));
/* close connection */
mysqli_close($link);
?>
The above examples will output:
MySQL Improved Extension (Mysqli)
Procedural style only: A link identifier returned by
mysqli_connect
example
2384
or
mysqli_init

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents