PHP mysqli_get_host_info() 函数

PHP 教程 · 2019-01-28 06:41:30

实例

返回 MySQL 服务器主机名和连接类型:

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

echo mysqli_get_host_info($con);

mysqli_close($con);
?>

定义和用法

mysqli_get_host_info() 函数返回 MySQL 服务器主机名和连接类型。

语法

mysqli_get_host_info(connection);

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

技术细节

返回值: 返回一个表示 MySQL 服务器主机名和连接类型的字符串。
PHP 版本: 5+

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

查看所有标签

Eric Meyer on CSS

Eric Meyer on CSS

Eric Meyer / New Riders Press / 2002-7-8 / USD 55.00

There are several other books on the market that serve as in-depth technical guides or reference books for CSS. None, however, take a more hands-on approach and use practical examples to teach readers......一起来看看 《Eric Meyer on CSS》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具