[eluser]bcarter[/eluser]
Hi there
I'm trying to display data but it's returning a blank page. I want to find out what the SQL is so that I can work out what the problem is but I don't know how.
Here's the code...
Model
Code:
<?php
class Sub_content_model extends Model {
function Sub_content_model() {
parent::Model();
}
function sub_content($id, $sid){
$query3 = $this->db->get_where('sub_content', array('section' => $id, 'sub_content_ID' => '$sid'));
return $query3->result();
}
}
?>
View
Code:
<?php foreach ($query3 as $row) { ?>
<?php echo $row->sub_content_title ?>
<?php echo $row->sub_content ?>
<?php } ?>
<?php $this->load->view('footer') ?>
And the Controller
Code:
function information() {
$id = '2';
$sid = $this->uri->segment(3);
$data['page_title'] = "Electrical Courses";
$this->load->model('Nav_model');
$data['query'] = $this->Nav_model->nav();
$this->load->model('Subnav_model');
$data['query2'] = $this->Subnav_model->subnav($id);
$this->load->view('head', $data);
$this->load->model('Sub_content_model');
$data['query3'] = $this->Sub_content_model->sub_content($id, $sid);
$this->load->view('information_view', $data);
}
Can somebody help please?!!!
Thanks