The mysql_thread_id() function is used to find the current thread ID.
PHP mysql_thread_id() Function Example:
The mysql_thread_id() function is used to find the current thread ID. The mysql_thread_id() function returns current thread ID on success or false for failure.
Syntax:
mysql_thread_id(connection)
Where connection is the current mysql database connection.
Example:
<?php $connection = mysql_connect("localhost", "root", "root"); if (!$connection) { die('PHP Mysql database connection could not connect : ' . mysql_error()); } echo "Thread id is " . mysql_thread_id(); mysql_close($connection); ?>
Output:
Thread id is 349
[ 0 ] Comments