Code:
<?php
$con = mysql_connect( "localhost", "user", "pass" ) or die( "can not connect" );
if( $con ) echo "Connected<br>";
$result = mysql_query( "SHOW FULL PROCESSLIST", $con );
while( $row = mysql_fetch_array( $result, $con ) )
{
$process_id = $row["id"];
if ($row["Time"] > 100 )
{
$sql = "KILL $process_id";
$res = mysql_query( "$sql", $con );
if( $res )
{
echo "Mysql Process ID $process_id has been killed<br>";
}
}
else echo "Row not found?<br>";
}
?>
but when i run this cron.php then i got this error
Connected
Warning: mysql_fetch_array() expects parameter 2 to be long, resource given in /home/r/public_html/da/cron.php on line 7