[eluser]kaos78414[/eluser]
So for practice I'm trying to create a blog with commenting functions and AJAX and all the normal stuff.
The problem I ran into, is I can't seem to pull a single entry for viewing. I have the entries truncated on the first page with a read more link, to bring them into full view.
This is the code for in the controller for viewing a blog entry:
Code:
function view() {
$data['post'] = $this->blogmodel->get_view();
$data['content'] = 'postview';
$this->load->view('includes/template', $data);
}
And this is in the model:
Code:
function get_view(){
$this->db->where('blogId', $this->uri->segment(3));
$query = $this->db->get('blogposts');
if ($query->num_rows() == 1) {
return $query->row();
}
return FALSE;
}
And the view has:
Code:
<div id="post">
<div id="post-title">
<?php echo $post->blogTitle; ?>
</div>
<div id="post-body">
<?php echo $post->blogBody; ?>
</div>
</div>
I've done some tutorials, but I just can't seem to see what I'm doing wrong here. Can anyone enlighten me?