mysql_list_processes()
resource mysql_list_processes([connection])This function returns a results set containing information on the server threads for the current connection: the connection identifier, the hostname, the database name, and the command. You may give an identifier to retrieve information for a different connection. Here is an example:
...
$processes = mysql_list_processes($connection);
while ($row = mysql_fetch_array($processes)){
print "$row['Id'], $row['Host'],
$row['db'], $row['Command']";
}
...