Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
print_r(mysqli_get_client_stats()['active_connections']);
echo PHP_EOL;
$result = $mysqli->query('SHOW SESSION STATUS;', MYSQLI_USE_RESULT);
while ($row = $result->fetch_assoc()) {
$array[$row['Variable_name']] = $row['Value'];
}
$result->close();
print_r($array['Threads_connected']);