11-14-2009, 07:47 PM
[eluser]GamingFusion[/eluser]
I want the home page to displays the welcome message set in the info table of the database. Buts its not. why?
Model
Controller (its doing other stuff just look at the last data entry(query))
View
I want the home page to displays the welcome message set in the info table of the database. Buts its not. why?
Model
Code:
function getInfo()
{
$query = $this->db->get('info');
return $query->row();
}
Controller (its doing other stuff just look at the last data entry(query))
Code:
function index()
{
$is_logged_in = $this->session->userdata('isLoggedIn');
if (!isset($is_logged_in) || $is_logged_in != TRUE)
{
$data['title'] = 'Theater 311';
$data['heading'] = 'Welcome to Theater 311';
$data['content'] = 'index';
$data['css'] = 'site';
$data['query'] = $this->database->getInfo();
$this->load->view('includes/templates', $data);
}
else
{
$data['title'] = 'Theater 311';
$data['heading'] = 'Welcome to Theater 311';
$data['content'] = 'index';
$data['css'] = 'site';
$data['isLoggedIn'] = $this->session->userdata('isLoggedIn');
$data['query'] = $this->database->getInfo();
$this->load->view('includes/templates', $data);
}
}
View
Code:
<h1><?=$heading?></h1>
<p<?=$this->typography->nl2br_except_pre($query->welcome)?></p>