The mysql_list_processes() function returns processes of current mysql connection on success or false for failure.
PHP mysql_list_processes() Function Example:
The mysql_list_processes() function returns processes of current mysql connection on success or false for failure.
Syntax:
mysql_list_processes(connection)
Where connection is optional. The connection specifies the mysql connection.
Example:
<?php $connection = mysql_connect("localhost", "root", "root"); if (!$connection) { die('PHP Mysql database connection could not connect : ' . mysql_error()); } $process_list = mysql_list_processes($connection); while ($rows = mysql_fetch_assoc($process_list)) { print_r($rows); echo "<br />"; } mysql_close($connection); ?>
After running this example the browser output is:
Output:
Array (
[Id] => 1
[User] => root
[Host] => VEERS:1221
[db] => php_mysql
[Command] => Sleep
[Time] => 3834
[State] => [Info] =>
)
[ 0 ] Comments