if($bbuserinfo['posts'] >= xxx and $bbuserinfo['usergroupid'] == 2) { $DB_site->query("UPDATE user SET usergroupid=x WHERE userid=$bbuserinfo[userid]"); }