[eluser]amrnt[/eluser]
... ops .. will DONE ..
Thanks for this great library!!!
but i have a question ... why limit() doesn't work with this ? or doesn't make sense!
controller
Code:
$data['category'] = $this->category->order_by('posts.id', 'DESC')->limit(1)->join_related('posts')->find($id);
$data['posts'] = $data['category']->posts;
SQL
Code:
SELECT `posts`.`id` AS `posts_id`, `posts`.`title` AS `posts_title`, `posts`.`body` AS `posts_body`, `posts`.`created_at` AS `posts_created_at`, `posts`.`updated_at` AS `posts_updated_at`, `posts`.`permalink` AS `posts_permalink`, `posts`.`category_id` AS `posts_category_id`, `categories`.*
FROM `categories`
LEFT JOIN `posts` ON categories.id = posts.category_id
WHERE `categories`.`id` = '4'
ORDER BY `posts`.`id` DESC
where i have to put limit() to limit my posts?