The question described above can't be considered 'high priority', but it still bothers me.

Lets say I need to retrieve data from a database. And I know for sure, that the data is there, because if it wasn't the whole application would be broken. But I am not trying to read a 'set of results' just ONE result. So what is the 'neatest' way to achieve this?

My application is built on the **codeigniter** framework, and by utilising active records this is the best I came up with so far:

```
$result = $this->db->from('some_table')->where('id',$id)->get()->result();
$record = $result[0];

```

I know that I could design the query a bit different (and maybe shorter) e.g. by using get\_where(...), but in the end it would still be a 'two-liner'.
This may be a 'luxury' problem, but I kinda hate the 'looks' of this code. Is there a way of making this a 'one-liner'?

On the other hand... if you think this is bad programming and I should not do this at all, tell me why and what I should do instead.

Your opinion is greatly appreciated!