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 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 default character set for the database connectionphp maxdb 函数 returns the thread id for the current connectionphp ncurses 函数 returns current erase characterphp odbc 函数 returns information about a current 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 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 recursivearrayiterator returns an iterator for the current entry if it is an array or an objectphp splobjectstorage returns the current storage entryphp splobjectstorage returns if the current iterator entry is validphp tokyotyrantiterator returns the current keyphp weakmap returns the current key under iteration
关注编程学问公众号