$db->query("delete from gb_temp where (temp4$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];