[eluser]f0n3man[/eluser]
Most of this code came from one of the wiki tutorials. I modified it in attempts to make it work. The controller is:
Code:
class Site extends Controller
{
function Site()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
$this->output->enable_profiler(TRUE);
}
function index()
{
$data['records'] = $this->site_model->get_records();
$this->load->view('site_view', $data);
}
and the model is:
Code:
class Site_model extends Model {
function Site_model()
{
// Call the Model constructor
parent::Model();
$this->load->database();
}
function get_records()
{
$query = $this->db->get('data');
return $query->result();
}
Since I'm absolutely new to OOP programming, I'm guessing it's something simple.