PHP mysqli_get_proto_info () function
Examples
Returns the MySQL protocol version:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// 检测连接
if (mysqli_connect_errno($con))
{
echo "数据库连接失败: " . mysqli_connect_error();
}
echo mysqli_get_proto_info($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_proto_info($con);
mysqli_close($con);
?>
Definition and Usage
mysqli_get_proto_info () function returns the MySQL protocol version.
grammar
mysqli_get_proto_info( connection ) ;
参数 | 描述 |
---|---|
connection | 必需。规定要使用的 MySQL 连接。 |
technical details
return value: | Returns a MySQL protocol version integer. |
---|---|
PHP version: | 5+ |
![PHP MySQLi Reference Manual](/images/up.gif)