downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mysql_unbuffered_query> <mysql_tablename
Last updated: Fri, 06 Nov 2009

view this page in

mysql_thread_id

(PHP 4 >= 4.3.0, PHP 5)

mysql_thread_idカレントのスレッド ID を返す

説明

int mysql_thread_id ([ resource $link_identifier ] )

カレントのスレッド ID を取得します。接続が一度切断され、 mysql_ping() によって再接続された場合には、 スレッド ID は変わります。つまり、スレッド ID は必要になったその時点で 取得すべきだということです。

パラメータ

link_identifier

MySQL 接続。 指定されない場合、mysql_connect() により直近にオープンされたリンクが 指定されたと仮定されます。そのようなリンクがない場合、引数を指定せずに mysql_connect() がコールした時と同様にリンクを確立します。 リンクが見付からない、または、確立できない場合、 E_WARNING レベルのエラーが生成されます。

返り値

成功した場合にスレッド ID 、失敗した場合に FALSE を返します。

例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

参考



add a note add a note User Contributed Notes
mysql_thread_id
There are no user contributed notes for this page.

mysql_unbuffered_query> <mysql_tablename
Last updated: Fri, 06 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites