Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.21.105.119
Current Path : /var/www/html/univadmin/ |
| Current File : /var/www/html/univadmin/kill_empty_connection.php |
<?php
//include 'database.php';
include("/var/www/config.php");
$servername = SERVERNAME;
$username = USERNAME;
$password = PASSWORD;
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
ini_set('max_execution_time', 300);
$sql = "SELECT concat('kill ', id,';') as col
FROM information_schema.processlist
WHERE command = 'Sleep' AND user = 'admin'
and ifnull(info,'') = ''
and time >30";
$result = mysqli_query($conn,$sql);
if($result)
{
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
$db = $row['col'];
$sql1 = "$db";
$result1 = mysqli_query($conn, $sql1);
}
}
echo "Completed";
?>
|