The mysqli_thread_id() function returns the thread ID for the current connection. The connection can then be killed with the mysqli_kill() function.
int $mysqli->thread_id;
int mysqli_thread_id ( mysqli $link )
The mysqli_thread_id() function returns the thread ID for the current connection which can then be killed using the mysqli_kill() function. If the connection is lost and you reconnect with mysqli_ping(), the thread ID will be other. Therefore you should get the thread ID only when you need it.
Error: MySQL server has gone away
Parameter | Description |
---|---|
link | Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init() |
Returns the Thread ID for the current connection.