[eluser]steelaz[/eluser]
Is there a reason why you don't want to join firstname and lastname strings after you get them from database (below)?
Code:
public function addToUserId($email, $new_to_user_id)
{
$this->db->select('firstname', 'lastname');
$this->db->from('fa_user');
$this->db->from('user');
$this->db->where('fa_user_id = id');
$this->db->where('user_id', $new_to_user_id);
$results = $this->db->get()->result();
$email_to = $email->getTo();
$email_to[] = $results[0]->firstname .'.'. $results[0]->lastname;
}
Also, if you're expecting just one result, instead of using result(), you can use row():
Code:
public function addToUserId($email, $new_to_user_id)
{
$this->db->select('firstname', 'lastname');
$this->db->from('fa_user');
$this->db->from('user');
$this->db->where('fa_user_id = id');
$this->db->where('user_id', $new_to_user_id);
$result = $this->db->get()->row();
$email_to = $email->getTo();
$email_to[] = $result->firstname .'.'. $result->lastname;
}