mysql_list_processes() function in PHP
What is mysql_list_processes() function in PHP?
How does mysql_list_processes() works?
Explanation
The
mysql_list_processes() function list MySQL processes.
Syntaxresource mysql_list_processes ( [resource link_identifier])
Returns a result pointer containing the current processes on success, or FALSE on failure.
The mysql_list_processes() function returns result pointer containing current MySQL connection processes.
Example
<?php //Attempt to connect to the default database server $link = mysql_connect("mysql_host", "mysql_user", "mysql_password") or die ("Could not connect"); //select database mysql_select_db("my_database", $link); //retrieves process information $my_list = mysql_list_processes($link); //list process information while ($row = mysql_fetch_assoc($my_list)) { print_r($row); } ?> |
RESULT:
Array
(
[Id] => 12
[User] => root
[Host] => localhost:2484
[db] => my_database
[Command] => Processlist
[Time] => 0
[State] =>
[Info] =>
)
See also: mysql_thread_id().