MySQLi - Client Version

语法

int mysqli_get_client_version ( mysqli $link )

定义和用法

它以字符串形式返回 MySQL 客户端版本

示例

试试下面的例子 −

<?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
", mysqli_get_client_version());
   
   mysqli_close($conn);
?>

上述代码的示例输出应该是这样的 −

Database connected Client version: 50011

mysqli_useful_functions.html