PHP mysql_list_processes() Function Example

PHP mysql_list_processes() Function Example


Posted in : PHP Posted on : February 21, 2011 at 6:44 PM Comments : [ 0 ]

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] =>
 )

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics