[eluser]benurv[/eluser]
using CI Active Record it's kinda tricky, if i need this i write my query directly not using AR, i love AR but it's a pain for those kind of things
you could trying to concatenate your AND statement in the AR lines
$this->db->select('*',FALSE);
$this->db->from('table');
$this->db->or_where("user_name","tom");
$this->db->or_where("friend_user_name","'tom' AND active = 1");
$this->db->get('');
don't know if it will work, let us know...