PHP mysqli_thread_safe() function returns whether the client library is compiled as thread-safe.
Syntax
bool mysqli_thread_safe(void);
Parameter | Description |
---|---|
NA | NA |
Return Values : | TRUE if the client library is thread-safe, otherwise FALSE. |
<?php $con = mysqli_connect("localhost","user","password","db"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Get thread id $thread_id = mysqli_thread_id($con); echo mysqli_thread_safe(); // Kill connection mysqli_kill($con,$thread_id); ?>