Welcome Guest, Not a member yet? Register   Sign In
Adding to data array for all functions in model
#4

[eluser]Pascal Kriete[/eluser]
$data is a class variable, so you have to access it in the class scope, by using $this:
Code:
function getCategories(){
    $query = $this->db->query("SELECT * FROM article_categories");
    $categories = $query->result_array();
    $this->data['categories'] = $categories;
    return $this->data;
}


Messages In This Thread
Adding to data array for all functions in model - by El Forum - 09-24-2008, 12:43 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 12:51 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 01:02 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 01:29 PM
Adding to data array for all functions in model - by El Forum - 09-24-2008, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB