MySQLi - Client Version



Syntax

int mysqli_get_client_version ( mysqli $link )

Definition and Usage

It returns the MySQL client version as a string

Example

Try out following example −

<?php
   $servername = "localhost:3306";
   $username = "root";
   $password = "";
   $dbname = "TUTORIALS";
   $conn = new mysqli($servername, $username, $password, $dbname);

   if ($conn->connect_error) {
      die("Connection failed: " . $conn->connect_error);
   } 
   echo "Database connected";
   printf("Client version: %d\n", mysqli_get_client_version());
   
   mysqli_close($conn);
?>

The sample output of the above code should be like this −

Database connected Client version: 50011
mysqli_useful_functions.htm
Advertisements