You are here : cpp0mysql_thread_id

mysql_thread_id() - 0

 Returns the thread ID of the current connection. This value can
        be used as an argument to
        mysql_kill() to kill the thread.mysql_kill()mysql_kill()If the connection is lost and you reconnect with
        mysql_ping(), the thread ID
        changes. This means you should not get the thread ID and store
        it for later. You should get it when you need it.mysql_ping()mysql_ping()Note


          This function does not work correctly if thread IDs become
          larger than 32 bits, which can occur on some systems. To avoid
          problems with
          mysql_thread_id(), do not use
          it. To get the connection ID, execute a SELECT
          CONNECTION_ID() query and retrieve the result.NoteThis function does not work correctly if thread IDs become
          larger than 32 bits, which can occur on some systems. To avoid
          problems with
          mysql_thread_id(), do not use
          it. To get the connection ID, execute a SELECT
          CONNECTION_ID() query and retrieve the result.mysql_thread_id()mysql_thread_id()SELECT
          CONNECTION_ID()


Syntax

unsigned long mysql_thread_id(MYSQL *mysql)


Example

 


Output / Return Value

 The thread ID of the current connection.


Limitations


Alternatives / See Also


Reference