[eluser]jecrs[/eluser]
Good day all!
I am just new working with CI and I found it great!
I started to work with blogs and i found this problem that makes me think a lot and maybe you guys has an easy solution on it.
In my blog index page i am showing list of all the blogs created at the same time i had also a link on "comment", to comment on a specific blog. My question would be on how to fetch the number of comments from each queried blogs, maybe just a number.
here is my controller name blogs
Code:
function Index(){
$data['title'] = 'Welcome to CI';
$data['header'] = 'Sample Blog Application...';
$data['blog'] = $this->blogsModel->getAll();
$this->load->view('blogsList',$data);
}
and my model for getAll on blogsModel
Code:
function getAll(){
$this->db->order_by('blog_created','desc');
return $this->db->get('blogs');
}
->how will i fetch the id within this function and call another function to count for the number of comment on the id get
// thnx