function doarchivetimeout(){ $archive = new archive(); $date = date('Y-m-d'); $sql = "UPDATE ".$archive->name." SET state='-1' WHERE outtime!='0000-00-00' AND outtime<='$date'"; $archive->query($sql); }