[eluser]BrianDHall[/eluser]
jedd is right on chaining, so I believe this would work:
Code:
$query = $this->db->select($type)->from('shop')->get();
Purely a matter of preference though.
As to the thread topic, this code is actually about as efficient as anyone could ask for.
Generally you have to screw up pretty bad to do something that is really going to effect performance in a big way - in fact, you rarely need to worry about performance until you actually experience a slow down and need to go back and optimize your program.
The only really 'dangerous' queries are unrestricted get() calls that pull in massive loads of records (if you store images in a database you have to be a little careful not to generate a select * from images sort of call, as you could be asking for gigabytes worth of information you didn't really need - or extremely complex joins on large tables with lots of records which are beyond my understanding.