Possible Duplicate:
Codeigniter Message: Undefined property: stdClass
location: application/core/student_model.php
class Student_model extends CI_Model
{
private $id;
public function __construct() {
parent::__construct();
}
public function setId($id){
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
location: application/controllers/test.php
class Test extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Student_model');
}
public function index()
{
$student = $this->student_model->setId('1234567');
echo $student->getId();
}
}
I am getting the following message/error.
Message: Undefined property: Test::$student_model
Filename: controllers/test.php
Line Number: 13
This line is where I am calling the method setId.
Can anyone see what I am doing wrong?