Welcome Guest, Not a member yet? Register   Sign In
Undefined Variable errors
#1

[eluser]russ_kern[/eluser]
I keep getting errors in my view file

"Severity: Notice

Message: Undefined variable: kitcost

Filename: PCMO/premium_detail.php

Line Number: 5"

I've been through the userguide over & over (and looked around here) and it seems like I should be doing this correctly but the error messages tells me otherwise. I feel like this is a really simple thing and it is driving me nuts as a result but I finally had to breakdown and ask if anyone could help.


The function in my Promotions model is:
Code:
function premium_detail($id)
    {
        
    $this->load->database('default');
    $this->db->where('promo_id', $id);
    $query = $this->db->get('promotions2010');
    
    return  $query->result_array();
    

    }

my controller looks like (simplified):

Quote: function premium_detail($id)
{

$this->load->model('Promotions');
$data['query'] = $this->Promotions->premium_detail($id);
$data['category'] = "PCMO";
$data['title'] = "Premiums";
$this->load->view('PCMO/includes/i_page_top', $data);
$this->load->view('includes/site_nav');
$this->load->view('PCMO/includes/i_header', $data);
$this->load->view('PCMO/premium_detail', $data);
$this->load->view('PCMO/includes/i_footer');

}

In my "premium_detail" view file I have:

Code:
<div id="fourcol_content">
        &lt;?php echo $kitcost ?&gt;<br>
        &lt;?php echo $kitcontents ?&gt;
        
</div>

where kit cost & Kit contents are record names form my promotions2010 table in my DB.

Can anyone show me why I am getting the errors?

Thanks in advance. Russ
#2

[eluser]russ_kern[/eluser]
Nevermind... I figured it out... I was right... it was something simple. (or at least the solution was)




Theme © iAndrew 2016 - Forum software by © MyBB