지금은 CodeIgniter의 2. 매우 간단한 모델 작성하려고 해요로 업그레이드 한 인식하지 못하는CodeIgniter는 2 모델 DB 객체
<?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();
}
}
을 그리고 난이 간단한 컨트롤러. 하지만 난 그것을 실행하려고 할 때 다음과 같은 오류를 얻을 : 객체의 멤버로 'DB'를 인식하지 못하는 것처럼
<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 />
보인다.
내가 잘못 했나요?
orderby 대신 order_by를 사용해 보셨습니까? – amd
당신은 흐름이 잘못되었습니다 먼저 어디서 주문 해야하는지 주문 order_by 사용하여 올바른이 –
그래, 이전 버전에서 또 다른 변화입니다. – Tomer