PHP Tutorial - PHP mysqli_thread_safe() Function






Definition

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

Syntax

PHP mysqli_thread_safe() Function has the following syntax.

mysqli_thread_safe();

Parameter

None

Return

It returns TRUE if the client library is thread-safe. FALSE otherwise.

Example

Is the client thread safe.


<?php
    $con=mysqli_connect("localhost","my_user","my_password","my_db");
    if (mysqli_connect_errno($con)){
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    echo mysqli_thread_safe();
    
    mysqli_kill($con,$t_id);
?>