[eluser]Kesey[/eluser]
I'm a beginner w/ PHP and CI. I've followed the blog tutorial and I'm trying to get the entry that one is commenting on to show up at the top of the comments page.
I can get all of the entries to show up, similar to how it works on the main blog page, but how can I get just the one entry instead of using the loop to pull them all?
Controller:
Code:
function comments()
{
$data['query'] = $this->db->get('entries');
$this->load->view('commentsview', $data);
}
View:
Code:
<!--Get Article-->
<?php foreach($query->result() as $row): ?>
<h3><?=$row->title?></h3>
<p><?=$row->body?></p>
<p><?=anchor('blog', 'Back to Blog');?></p>
<hr>
<?php endforeach; ?>
<!-- End Get Article-->
Thanks!