Forum und email

mysql_thread_id

(PHP 4 >= 4.3.0, PHP 5, PECL mysql:1.0)

mysql_thread_id — Geef het huidige thread ID terug

Beschrijving

int mysql_thread_id ([ resource $link_identifier ] )

mysql_thread_id() geeft het huidige thread ID terug. Als de connectie is verbroken en je maakt weer verbinding met mysql_ping(), zal het thread ID veranderen. Dit betekent dat je het thread ID niet moet ophalen om het te bewaren voor later. Je moet het ophalen wanneer je het nodig hebt.

Example#1 mysql_thread_id() voorbeeld

<?php
$link 
mysql_connect('localhost''mysql_user''mysql_password');
$thread_id mysql_thread_id($link);
if (
$thread_id){
    
printf ("huidig thread id is %d\n"$thread_id);
}
?>

Het bovenstaande voorbeeld zou de volgende output produceren:

current thread id is 73

Zie ook: mysql_ping(), mysql_list_processes().