[eluser]David Mitchell[/eluser]
Controller
Code:
//Home
function index()
/////////////////////////////Gets Message Data//////////////////////////////////////
$userid = $this->session->userdata('id');
$this->db->select('*')->from('message')->where('user', $userid);
$data['test'] = $this->db->get();
/////////////////////////////////////////////////////////////////////////////////////////
$this->load->view('index', $data);
}
index.php view file
Code:
<? include("include/header.php"); ?>
<?php
if ($test->num_rows() > 0)
{
foreach ($test->result() as $row)
{
echo $row->user;
echo $row->message;
echo $row->created;
}
echo "Nothing to Display";
}
?>
<? include("include/footer.php"); ?>
Its not displaying anything, and the database is working fine. Have I done something Wrong?
David