(PHP 4 >= 4.3.0, PHP 5)
mysql_thread_id — Return the current thread ID
Retrieves the current thread ID. If the connection is lost, and a reconnect with mysql_ping() is executed, the thread ID will change. This means only retrieve the thread ID when needed.
Връзката към MySQL. Ако не е указана, се използва последната създадена връзка от mysql_connect(). Ако не намери такава връзка, ще направи опит да установи връзка, все едно е изпълнена mysql_connect() без параметри. Ако случайно не е намерена или създадена никаква връзка, ще се генерира предупреждение от ниво E_WARNING.
The thread ID on success, or FALSE on failure.
Example #1 mysql_thread_id() example
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$thread_id = mysql_thread_id($link);
if ($thread_id){
printf("current thread id is %d\n", $thread_id);
}
?>
Примерът по-горе ще изведе нещо подобно на:
current thread id is 73