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 eventbufferevent returns underlying input buffer associated with current buffer eventphp 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 ibm db2 函数 returns a persistent connection to a databasephp informix 函数 returns the current file or seek positionphp maxdb 函数 returns the thread id for the current connectionphp odbc 函数 returns information about a current connectionphp sqlite 函数 returns the current row indexphp yaz 函数 returns value of option for connectionphp 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 open a new connection to the mysql serverphp 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 ktaglib tag returns the album string from a id3 tag
关注编程学问公众号