= 4.3.0, PHP 5)mysql_thread_id — 返回當(dāng)前線程的 ID說明mysql_thread_id(resource $link_identifier = ?): intmysql_thread_id() 返回當(dāng)前線程的 ID。如果">
(PHP 4 >= 4.3.0, PHP 5)
mysql_thread_id — 返回當(dāng)前線程的 ID
$link_identifier
= ?): intmysql_thread_id() 返回當(dāng)前線程的 ID。如果連接丟失了并用 mysql_ping() 重新連接上,線程 ID 會改變。這意味著不能取得線程的 ID 后保存起來備用。當(dāng)需要的時候再去獲取之。
示例 #1 mysql_thread_id() 例子
<?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);
}
?>
以上例子將產(chǎn)生如下輸出:
current thread id is 73