if ($userfield['field16']=='yes') // change this to suit you { $user['usergroupid'] = 12; // change this to suit you. }