[eluser]summery[/eluser]
Congrats on learning CI, glad you got the blog working so far!
I think the problem is that "if" and "as" are not usually used together. Instead, just use an if statement. Since you're querying on an id, you'll only get one row back:
Code:
if ($query->num_rows() > 0)
{
$row = $query->row();
$data[‘title’] = $row->title;
$data[‘heading’] = $row->body;
}
Also, I think you might get some unexpected results with your title and heading. The title is an html title that appears at the top of your browser window; the heading is an h1 heading that appears at the top of the page. You probably don't want your entire blog post in huge, bold black type before your comment form. Try:
Code:
$data[‘title’] = $row->title . " Comments | My Site";
$data[‘heading’] = $row->title;
Good luck, let me know if it works/if you solved it some other way!