Custom fields in User registration, how to save?
If you insist use code I suggest below method 

function all_data_form_submit($form, &amp;$form_state) {
$fname = $form_state['values']['field_first_name']['und'][0]['value'];
$lname = $form_state['values']['field_last_name']['und'][0]['value'];
$name=trim($form_state['values']['name']);
$myuser=user_load_by_name($name);
if(!empty($myuser)){
        $edit = array(
                'field_first_name' =&gt; array(LANGUAGE_NONE =&gt; array(array('value' =&gt;$form_state['values']['field_first_name']))),
                // .. and every field you want to save
                );
        user_save($myuser, $edit);
    }
}