[eluser]xwero[/eluser]
A quick solution to use the fastest queries and the least data using AR
Code:
function get_profiles($fields)
{
if(!empty($fields){ $this->db->select($fields); }
return $this->db->get('table')->result();
}
function get_profile($id,$fields='')
{
if(!empty($fields){ $this->db->select($fields); }
return $this->db->get_where('table',array('id'=>$id))->row();
}
It's too bad the get and get_where method don't provide this option themselves because i think there are more queries where you need to get specific fields/columns than there are getting all the fields from a table.