PHP – MySQL Processes Information

The given PHP example helps you to get the info of all mysql processes.

Code Example:
$server = "localhost";
$username = "root";
$password = "";
$conn =  mysql_connect($server, $username, $password) or die("Couldn't connect to MySQL" . mysql_error());
$processes = mysql_list_processes();
echo "<table>";
echo "<tr><th>ID</th><th>User</th><th>Host</th><th>DB</th>

while ($row = mysql_fetch_row($processes)) {
  list($id,$user,$host,$db,$command,$time,$state,$info) = $row;
  echo "<tr><td>$id</td><td>$user</td>
echo "</table>";

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Comment

Your email address will not be published. Required fields are marked *