How would I change this Query builder from Kohana 2.4 to Kohana 3?
- by Thorpe Obazee
I have had this website built for a few months and I am just getting on Kohana 3. I'd just like to convert this K2.4 query builder to K3 query builder.
return DB::select(array('posts.id', 'posts.created', 'posts.uri', 'posts.price', 'posts.description', 'posts.title',
'image_count' => db::expr('COUNT(images.id)')))
->from('posts')
->join('images')->on('images.post_id', '=', 'posts.id')
->group_by(array('posts.id'))
->order_by('posts.id', 'DESC')
->limit($limit)
->offset($offset)
->execute();