[eluser]millo[/eluser]
Thanks WalesMD,
That's what I thought, but I've tried that and it doesn't work.
You see, in the view that I'm loading in for that code I've got a header and footer include ...
Code:
<?php $this->load->view('main/includes/header'); ?>
<?php $page_row = $page_contents_query->row(); ?>
<h1><?php echo $page_row->page_title; ?></h1>
<?php echo markdown($page_row->text); ?>
<?php $this->load->view('main/includes/footer'); ?>
... it's in the header where I'm calling on this data and for some reason it doesn't like it unless I instantiate it directly in the function (as opposed to globally).
This is the code in the header ...
Code:
<ul class="l1">
<?php foreach($all_sections_query->result() as $section_row) { ?>
<li class="l1"><strong><?php echo $section_row->title ?></strong></li>
<ul class="l2">
<?php foreach($page_list_query->result() as $page_row) { ?>
<?php if ($section_row->section_id == $page_row->section_id) { ?>
<li class="l2"><a href="/main/page/<?php echo $page_row->page_id; ?>"><?php echo $page_row->menu_title; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</ul>
Any idea why my header that's included in the view doesn't like it?
This is the error I get:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: all_sections_query
Filename: includes/header.php