PDF(美国高级主任)- 2.4 mb
PDF (A4)- 2.4 mb
mysqli: protocol_version美元
mysqli_get_proto_info
返回使用的MySQL协议版本
描述
面向对象的风格
intmysqli - > protocol_version;
程序上的风格
intmysqli_get_proto_info(mysqlimysql);
属性所表示的连接所使用的MySQL协议版本mysql
参数。
参数
-
链接
-
仅限过程式样式:返回的链接标识符
mysqli_connect
或mysqli_init
返回值
返回表示协议版本的整数。
例子
例3.49mysqli - > protocol_version
例子
面向对象的风格
<?PHP $mysqli = new mysqli("localhost", "my_user", "my_password");/*检查连接*/ if (mysqli_connect_errno()) {printf("Connect failed: %s\n", mysqli_connect_error());退出();} /*打印协议版本*/ printf("协议版本:%d\n", $mysqli->协议版本);/*关闭连接*/ $mysqli->close();? >
程序上的风格
<?PHP $link = mysqli_connect("localhost", "my_user", "my_password");/*检查连接*/ if (mysqli_connect_errno()) {printf("Connect failed: %s\n", mysqli_connect_error());退出();} /*打印协议版本*/ printf("协议版本:%d\n", mysqli_get_proto_info($link));/ / mysqli_close($link);? >
上面的例子将输出:
协议版本:10
另请参阅
mysqli_get_host_info |