CodeIgniter syntax
Here is my code:
$this->load->mo开发者_Python百科del('login/configurations', '', TRUE);
$data['query'] = $this->configurations->load_data();
But my query is not being loaded here:
$data['title'] = 'User Area';
$data['main_content'] = 'resources/logged_in_area';
$this->load->view('templates/resources_area', $data);
I think it may have to do with the path of my model. "Login" is the name of the folder "configurations" is in. The title and main_content variables are loaded into my view. The resources area template loads my header, footer and nav views. So I know the last three lines of code are valid. It's the first three that are not working.
Here is my load_data function:
function load_data() {
$query = $this->db->query("SELECT * FROM configurations WHERE username=" . $this->session->userdata('username'));
return $query;
}
Anyone have any thoughts? I get an undefined variable error in my view. ($query)
精彩评论