[eluser]dgriffter[/eluser]
the code is as follows:
<?php
class main extends Controller {
function main(){
parent::Controller();
$this->load->library('session');
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('email');
}
function index(){
//echo 'test text ';
$session_id = $this->session->userdata('session_id');
$data['session_id']=$session_id ;
$data['title']='Page Title';
$data['query']= $this->db->query("SELECT * FROM family ORDER BY idfamily asc");
$data['query2']= $this->db->query("SELECT * FROM subfamily ORDER BY idsubfamily asc");
if ($data['query2']->num_rows() > 0)
{
$row = $data['query2']->row();
echo $row->idsubfamily;
}
$data['query3']= $this->db->query("SELECT * FROM product WHERE idsubfamily=".$row->idsubfamily." ");
$this->load->view('main_view', $data);
}
}
?>
The echo $row->idsubfamily; returns 23, the correct id from the database, but the $this->load->view('main_view', $data); doesn't display the main_view.php file, which is full of html and other stuff.
Thank you for looking,
Dgriffter