[eluser]H8train[/eluser]
ok that at least got me some output but no content. my view looks like this:
Code:
<h3><?=$row->title?></h3>
<small>Posted on: <?=$row->date?></small><br>
<p><?=$row->body?></p><br>
<p><?=anchor('blog/comments/'.$row->id, 'comments');?></p>
its not grabbing the actual content and my anchor link doesnt contain the post ID anymore so the comments won't work correctly.
ok heres all that I have that works properly:
from My blog.php controller
Code:
function index()
{
$data['query'] = $this->db->get('entries');
$this->load->view('blog_view', $data);
}
from my blog_view.php view file:
Code:
<p>
<?php foreach($query->result() as $row): ?>
<h3><?=$row->title?></h3>
<small>Posted on: <?=$row->date?></small><br>
<p><?=$row->body?></p><br>
<p><?=anchor('blog/comments/'.$row->id, 'comments');?></p>
<hr>
<?php endforeach; ?>
</p>
and my output is flowing like this:
Code:
Post 1 date 2005
Post 2 date 2006
Post 3 date 2007
but I want my output to flow like this:
Code:
Post 3 date 2007
Post 2 date 2006
Post 1 date 2005
I just want the newly posted data to be added at the top and not the bottom.
if anyone can help me to achieve this it would be greatly appreciated. I am new to PHP and would think this is an easy fix to a seasoned PHP coder.
Thank you for your replies.
Rich