note 34658 deleted from features.persistent-connections by didou
| From: | didou@php.net | Date: | Sun, 03 Aug 2003 10:07:02 +0000 |
| Subject: | note 34658 deleted from features.persistent-connections by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53244@lists.php.net to get a copy of this message | ||
Note Submitter: davro@davro.net
----
function mysqlKillProcess()
{
$result = mysql_query("SHOW processlist");
while ($row = mysql_fetch_array($result))
{
$mysqlPid = $row["Id"];
if (($row["Time"] > 150) || ($row["Command"] == "Sleep"))
{
$sql = "kill $mysqlPid";
//print "<pre>$row</pre>";
//print "Killing " . $row["Id"];
mysql_query($sql);
}
}
mysql_free_result($result);
}
Quiet a handy one to run once you have finished populating stuff.
Easily plugable so the client can do some cleaning up.