PHP mysqli_get_server_version() 函数

PHP 教程 · 2019-01-28 07:29:48

实例

将 MySQL 服务器版本作为整数返回:

<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// 检测连接
if (mysqli_connect_errno($con))
{
     echo "数据库连接失败: " . mysqli_connect_error();
}

echo mysqli_get_server_version($con);

mysqli_close($con);
?>

定义和用法

mysqli_get_server_version() 函数将 MySQL 服务器版本作为整数返回。

MySQL 服务器版本将按照以下格式返回: 主要版本*10000 + 次要版本*100 + 子版本。例如:5.1.0 将返回 50100。

语法

mysqli_get_server_version(connection);

参数 描述
connection 必需。规定要使用的 MySQL 连接。

技术细节

返回值: 返回一个表示 MySQL 服务器版本的整数。
PHP 版本: 5+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Ordering Disorder

Ordering Disorder

Khoi Vinh / New Riders Press / 2010-12-03 / USD 29.99

The grid has long been an invaluable tool for creating order out of chaos for designers of all kinds—from city planners to architects to typesetters and graphic artists. In recent years, web designers......一起来看看 《Ordering Disorder》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具