欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

網站當前的在線人數

 更新時間:2006年10月09日 00:00:00   作者:  
這是我的多用戶統(tǒng)計的在線統(tǒng)計部分

gb_temp表:
temp1 用戶ID
temp2 流覽IP地址  
temp3 online//做了個標記,因為其他功能也要使用這個表
temp4 登陸時間

$onlinetime最長離線時間分鐘
db_class是我定義的一個數據庫操作類。

///////////////////
//在線統(tǒng)計
$db = new db_class;
$db->connect();

$limit_time = time() - ($onlinetime * 60);
$online_time = time();

$db->query("delete from gb_temp where (temp4<$limit_time or temp2='$ip') and temp1='$id' and temp3='online'"); //刪除離線$onlinetime分鐘的用戶
$db->query("insert into gb_temp (temp1,temp2,temp3,temp4) values ('$id','$ip','online','$online_time')");
$onres = $db->query("select count(*) from gb_temp where temp1='$id' and temp3='online'");
$onlineuser = $db->fetch_array($onres);
$onlineuser = $onlineuser[0]; 

相關文章

最新評論