[eluser]Atharva[/eluser]
[quote author="Medikal" date="1291741010"]I am using it to select all posts from the database, the main issue is having my selectComments function be able to refer to each id in the selectPosts.[/quote]
Ok, so in that case, you need to keep your previous code in model and loop in the controller like
Code:
foreach($template['blogPosts'] as $val){
$template['comments'] = $this->blog_model->selectComments($val->postID);
}
have you tried this?
Of course, $template['comments'] will get overwritten each time in loop, so you need to store in different way.