MysqlndUhConnection::getThreadId

(PECL mysqlnd-uh >= 1.0.0-alpha)

MysqlndUhConnection::getThreadIdReturns the thread ID for the current connection

说明

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

Returns the thread ID for the current connection.

参数

connection

Mysqlnd connection handle. Do not modify!

返回值

Connection thread id.

范例

Example #1 MysqlndUhConnection::getThreadId() example

<?php
class proxy extends MysqlndUhConnection {
 public function 
getThreadId($res) {
  
printf("%s(%s)\n"__METHOD__var_export(func_get_args(), true));
  
$ret parent::getThreadId($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->thread_id);
?>

以上例程会输出:

proxy::getThreadId(array (
  0 => NULL,
))
proxy::getThreadId returns 27646
int(27646)

参见

相关文章
php deque returns the current capacityphp eventbufferevent returns the current cipher name of the ssl connectionphp eventbufferevent returns version of cipher used by current ssl connectionphp eventbufferevent returns the name of the protocol used for current ssl connectionphp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp maxdb 函数 returns the current row of a result set as an objectphp maxdb 函数 returns the auto generated id used in the last queryphp maxdb 函数 returns the thread id for the current connectionphp odbc 函数 returns information about a current connectionphp imagickdraw returns the current stroke antialias settingphp mongocommandcursor returns the current result s index within the result setphp mongocursor returns the current result s id or its index within the result setphp mysqlnduhconnection returns the default character set for the database connectionphp mysqlnduhconnection escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp mysqlnduhconnection returns a string representing the type of connection usedphp mysqlnduhconnection returns the auto generated id used in the last queryphp mysqlnduhconnection returns statistics about the client connectionphp mysqlnduhconnection returns the thread id for the current connectionphp solrquery returns the current state of the facet.missing parameterphp swoole connection iterator return key of the current connection.
关注编程学问公众号