赣南脐橙

佰草伐

导航

PHP mysqli_get_host_info() 函数

定义和用法

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


语法

mysqli_get_host_info(connection);

返回 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);
?>

 

posted on 2019-07-16 15:00  佰草伐  阅读(134)  评论(0编辑  收藏  举报

自定义导航网站

php基础知识

Wood Furniture