<?php
defined('PROTECTOR') OR die('Все работает!');
$time=time();
$temp = mysql_query("SELECT * FROM `temp` WHERE `user`='$log' AND `status`='off'");
While($temp = mysql_fetch_array($temp)){
if($temp['status']=='off' AND $temp['ltime']+300<=$time){
mysql_query("DELETE FROM `temp` WHERE `user`='$log' AND `id`='$temp[id]'");
}
}
$temp = mysql_fetch_array($temp);
if($temp['status']=='off' AND $temp['ltime']+300<=$time){
mysql_query("DELETE FROM `temp` WHERE `user`='$log' AND `id`='$temp[id]'");
}
$per=$time-1200;
$tim = mysql_query("SELECT * FROM `temp` WHERE `user`='$log' AND `ltime`<'$per'");
While($temp = mysql_fetch_array($tim)){
mysql_query("DELETE FROM `temp` WHERE `user`='$log' AND `ltime`='$temp[ltime]'");
}
?>