note 34658 added to features.persistent-connections
| From: | davro at davro dot net | Date: | Sat, 02 Aug 2003 20:48:58 +0000 |
| Subject: | note 34658 added to features.persistent-connections | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53223@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/features.persistent-connections.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34658
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34658&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34658&report=yes