benedmunds/CodeIgniter-Ion-Auth — pull request #152 by axelay (2012-01-08 12:13:21+00:00)
Title: select specific fields

Hey,

I needed to pull out all the users' email addresses from my database and their id... When I was using ->users() it gave me the full dataset with all the fields which was pointless to me in that case and a lot of resources used for nothing. I have changed the model slightly and added a _ion_select variable which can be set using the select(...) function and acts like the where(...) function.
So now I just need to do:
```$emails = $this->ion_auth->select('id, email')->users()->result();```

Alex

PS: also tried to embellish the code a tad more as well as changing 2 selects into 1 :)