PHP mysqli_kill() function kills MySQL server thread mentioned by processid.
Syntax
bool mysqli_kill(connection, processid);
Parameter | Description |
---|---|
connection : | Required parameter. The MySQL connection to be used |
processid : | Required parameter. The thread ID returned from mysqli_thread_id() |
Return Values : | Returns TRUE on success or FALSE on failure. |
<?php $con = mysqli_init(); if (!mysqli_real_connect($con,"localhost","user","password","db")) { die("Connection Error: " . mysqli_connect_error()); } $thread_id = mysqli_thread_id($con); // kill connection by threadid mysqli_kill($con, $thread_id); mysqli_close($con); ?>