PHP mysql_list_processes() functie
Definitie en gebruik
De mysql_list_processes() functie lijst MySQL-processen op.
Als succesvol, retourneert mysql_list_processes() een resultaatwijzer die de huidige threads van de server beschrijft. Als mislukt, retourneert het false.
Syntax
mysql_list_processes(verbinding)
Parameters | Beschrijving |
---|---|
verbinding | Optioneel. Specificeer de MySQL-verbinding. Als dit niet wordt gespecificeerd, wordt de vorige verbinding gebruikt. |
Voorbeeld
<?php $con = mysql_connect("localhost", "hello", "321"); if (!$con) { die('Could not connect: ' . mysql_error()); } $my_list = mysql_list_processes($con); while ($row = mysql_fetch_assoc($my_list)) { print_r($row); } mysql_close($con); ?>
Uitvoer lijkt op:
Array ( [Id] => 2 [User] => hello [Host] => localhost:1038 [db] => [Command] => Processlist [Time] => 0 [State] => [Info] => )