PHP mysqli_thread_safe() Function

PHP mysqli_thread_safe() function returns whether the client library is compiled as thread-safe.

Syntax

bool mysqli_thread_safe(void);

mysqli_thread_safe() Function Parameter

ParameterDescription
NANA

mysqli_thread_safe() Function Return Value

Return Values :TRUE if the client library is thread-safe, otherwise FALSE.

mysqli_thread_safe() Function Example

<?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);

?>