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);
?>
$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
Hadoop: The Definitive Guide
Tom White / O'Reilly Media, Inc. / 2009 / 44.99
Apache Hadoop is ideal for organizations with a growing need to store and process massive application datasets. Hadoop: The Definitive Guide is a comprehensive resource for using Hadoop to build relia......一起来看看 《Hadoop: The Definitive Guide》 这本书的介绍吧!
随机密码生成器
多种字符组合密码
RGB CMYK 转换工具
RGB CMYK 互转工具