[eluser]-spy-[/eluser]
this is weird, i can now generate the query, and retrieve data from the database, i tried again to put my query inside the controller, it's now working.. but unfortunately i can't make it in the model...
Fatal error: Call to a member function result() on a non-object in D:\Program Files\xampp\htdocs\pupcomm\system\application\views\profile\history.php on line 44
here's my code in profile.php
Code:
<?php
class Profile extends Controller {
function Profile()
{
parent::Controller();
}
function history()
{
$this->load->model('Student');
$data['query'] = $this->Student->view_list();
//$data['query'] = $this->db->query("SELECT * FROM SAMPLE_RECORDLIST");
$this->load->view('profile/history', $data);
}
}
?>
here's my code in student.php
Code:
<?php
class Student extends Model {
function Student()
{
parent::Model();
}
function view_list()
{
$query = $this->db->get('sample_recordlist');
return $query->result();
}
}
?>
hope you can help me again...