PHP 手冊
上一頁 |  | 下一頁

# mysql_thread_id

(PHP 4 >= 4.3.0, PHP 5)

mysql_thread_id -- Return the current thread ID

## Description

int mysql_thread_id ( [resource link_identifier])

mysql_thread_id() returns the current thread ID. If the connection is lost and you reconnect with mysql_ping(), the thread ID will change. This means you should not get the thread ID and store it for later. You should get it when you need it.

示範 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); } ?>`
The above example would produce the following output:
    current thread id is 73

See also mysql_ping() and mysql_list_processes().

上一頁 | 最開頭 | 下一頁
mysql_tablename | 上一層 | mysql_unbuffered_query