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 map returns the current capacityphp ev returns the current time in fractional seconds since the epochphp 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 or sets the autocommit state for a database connectionphp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp maxdb 函数 returns the thread id for the current connectionphp maxdb 函数 returns whether thread safety is given or notphp ncurses 函数 returns current soft label key attributephp odbc 函数 returns information about a current connectionphp posix 函数 return the effective user id of the current processphp imagickdraw returns the current polygon fill rulephp 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 connection
关注编程学问公众号