[eluser]fatman[/eluser]
Hi,
I'm using the latest version and I'm trying to write a very simple model:
Code:
<?php
class Test extends CI_Model{
function __construct(){
parent::__construct();
}
function test(){
$this->db->orderby ( 'updateDate', 'desc' );
$this->db->where ( 'logicalDelete', 0 );
$rs = $this->db->get ( 'act_activity_vw' );
if (! $rs) {
throw new DatabaseException ();
}
return $rs->result ();
}
}
and from the controller I call it by:
Code:
$this->model->test();
But when i'm calling the controller i get this:
Code:
<b>Fatal error</b>: Call to a member function orderby() on a non-object in <b>C:\xampp\htdocs\API\application\models\test.php</b> on line <b>9</b><br />
It seems like it does not recognize 'db' as a member of the object, any clue why?