mysql_thread_id

Return the current thread ID

&mysql.alternative.note;

- `mysqli_thread_id`

&reftitle.description; ``int``false```mysql_thread_id` `resource` `link_identifier` NULL

Retrieves the current thread ID. If the connection is lost, and a reconnect with `mysql_ping` is executed, the thread ID will change. This means only retrieve the thread ID when needed.

&reftitle.parameters;

&mysql.linkid.description;
&reftitle.returnvalues;

The thread ID on success&return.falseforfailure;.

&reftitle.examples;

### `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);
    }
    ?>

&example.outputs.similar;

    current thread id is 73

&reftitle.seealso;

- `mysql_ping`
- `mysql_list_processes`