Код: Выделить всё
$this->db->select(
'(select var_value from contents where table = "products" and table_id = products.id and var_name = "image" and name = "images" order by id asc limit 1) as main_picture'
);
$this->db
->where('category_id', $cat)
->from('products')
->limit($limit, $start)
->get();
Подробнее здесь: https://stackoverflow.com/questions/628 ... lect-query
Мобильная версия