$query=$db->query("select onlinemonth,uid from $tablepre"."members where adminid>0");
while($onmonth = $db->fetch_array($query)){
$lastmonthonline=$onmonth[onlinemonth];
$uid=$onmonth[uid];
$db->query("update $tablepre"."members set lastmonthonline=$lastmonthonline where uid=$uid");
}