Q:

codeigniter assigning values got from model to variables in controller

I use Codeigniter and I want to return user_id and name from model and then use them as variables in controller but not sure if I correctly values to variables in controller. Could you please have a look at my code.
model:
if ($query->num_rows() == 1) {            
    $row = $query->row();
    return array('user_id' => $row->user_id, 'name' => $row->name);
}

controller:
$user_id = $this->model_users->get_user_id_name($email);
$user_name = $this->model_users->get_user_id_name($email);

A:

You are returning an associative array from model , 
catch it in controller as
$userinfo = $this->model_users->get_user_id_name($email);

$user_id =  $userinfo['userid']; 
$user_name =  $userinfo['name'];
If in case you want to return a indexed array , pass it as
if ($query->num_rows() == 1) {            
    $row = $query->row();
    return array( $row->user_id,  $row->name);
}

$user_id =  $userinfo[0]; 
$user_name =  $userinfo[1];

