PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<mysql_tablenamemysql_unbuffered_query>
Last updated: Mon, 16 Jul 2012

mysql_thread_id

(PHP 4 >= 4.3.0, PHP 5)

mysql_thread_id -- 返回当前线程的 ID

说明

int mysql_thread_id ( [resource link_identifier] )

mysql_thread_id() 返回当前线程的 ID。如果连接丢失了并用 mysql_ping() 重新连接上,线程 ID 会改变。这意味着不能取得线程的 ID 后保存起来备用。当需要的时候再去获取之。

例子 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);
}
?>

以上例子将产生如下输出:

current thread id is 73

参见 mysql_ping()mysql_list_processes()




<mysql_tablenamemysql_unbuffered_query>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST