Oracle 5.0 Reference Manual page 2808

Table of Contents

Advertisement

Return Values
A mysqlnd connection handle.
Changelog
Version
5.4.0
Examples
Example 20.388.
<?php
/* PDO user API gives no access to connection thread id */
$mysql_connection = new PDO("mysql:host=localhost;dbname=test", "root", "");
/* Convert PDO MySQL handle to mysqlnd handle */
$mysqlnd = mysqlnd_uh_convert_to_mysqlnd($mysql_connection);
/* Create Proxy to call mysqlnd connection class methods */
$obj = new MySQLndUHConnection();
/* Call mysqlnd_conn::get_thread_id */
var_dump($obj->getThreadId($mysqlnd));
/* Use SQL to fetch connection thread id */
var_dump($mysql_connection->query("SELECT CONNECTION_ID()")->fetchAll());
?>
The above example will output:
int(27054)
array(1) {
[0]=>
array(2) {
["CONNECTION_ID()"]=>
string(5) "27054"
[0]=>
string(5) "27054"
}
}
See Also
mysqlnd_uh.enable
20.7.8.9.2.
mysqlnd_uh_set_connection_proxy
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysqlnd_uh_set_connection_proxy
Installs a proxy for mysqlnd connections
Description
bool mysqlnd_uh_set_connection_proxy(
MysqlndUhConnection connection_proxy,
mysqli mysqli_connection);
Mysqlnd user handler plugin (mysqlnd_uh)
mysqlnd_uh_convert_to_mysqlnd
Description
The
mysql_connection
of type mysql, PDO_MySQL, or mysqli. Before,
only the
mysqli
example
2788
parameter can now be
type was allowed.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents