MysqlndUhConnection::getServerVersion

(PECL mysqlnd-uh >= 1.0.0-alpha)

MysqlndUhConnection::getServerVersionReturns the version of the MySQL server as an integer

说明

public MysqlndUhConnection::getServerVersion ( mysqlnd_connection $connection ) : int

Returns the version of the MySQL server as an integer.

参数

connection

Mysqlnd connection handle. Do not modify!

返回值

The MySQL version.

范例

Example #1 MysqlndUhConnection::getServerVersion() example

<?php
class proxy extends MysqlndUhConnection {
 public function 
getServerVersion($res) {
  
printf("%s(%s)\n"__METHOD__var_export(func_get_args(), true));
  
$ret parent::getServerVersion($res);
  
printf("%s returns %s\n"__METHOD__var_export($rettrue));
  return 
$ret;
 }
}
mysqlnd_uh_set_connection_proxy(new proxy());

$mysqli = new mysqli("localhost""root""""test");
var_dump($mysqli->server_version);
?>

以上例程会输出:

proxy::getServerVersion(array (
  0 => NULL,
))
proxy::getServerVersion returns 50145
int(50145)

参见

相关文章
php evloop returns an integer describing the backend used by libevphp maxdb 函数 returns the version of the maxdb server as an integerphp mssql 函数 returns the last message from the serverphp mysql xdevapi 函数 connect to a mysql serverphp mysqlnd ms 函数 查询给定的 sql 会发送给 master、slave 还是最后使用的 mysql server 执行。php postgresql 函数 returns the current in transaction status of the serverphp hyperwave api 函数 returns statistics about document cache serverphp mongodb driver monitoring commandsucceededevent returns the server on which the command was executedphp mongodb driver server returns an integer denoting the type of this serverphp mongodb driver writeresult returns the server associated with this write resultphp mysqlnduhconnection open a new connection to the mysql serverphp mysqlnduhconnection gets the number of affected rows in a previous mysql operationphp mysqlnduhconnection returns the version of the mysql protocol usedphp mysqlnduhconnection returns the version of the mysql serverphp mysqlnduhconnection returns the version of the mysql server as an integerphp mysqlnduhconnection returns the sqlstate error from previous mysql operationphp mysqlnduhconnection returns the number of warnings from the last query for the given linkphp mysqlnduhconnection asks the server to kill a mysql threadphp mysqlnduhconnection dump debugging information into the log for the mysql serverphp solrpingresponse returns the response from the server
关注编程学问公众号