2014-11-13 2 views
0
$this->db->select('employee_name'); 
$this->db->from('employee'); 
$this->db->limit(1,0); 
$query = $this->db->get(); 
return $query->result(); 

데이터 테이블에이 쿼리를 쓰는 방법. 아래에 쿼리를 작성했습니다.점화 된 데이터 테이블의 한도

$this->datatable->select('employee_name') 
->from('employee'); 
$this->datatable->limit(1,0); 
return $this->datatables->generate(); 

그러나 오류가 있습니다.

+0

방법'제한()이

의 시도 CodeIgniter를 사용 생각'아니다 datatables 라이브러리에 정의됩니다. 나는 아직도 이것을 찾고있다. –

답변

0

난 당신이 일반 쿼리를 따라 체인 방법, 방법 체인에 의해

$this->datatables->select('employee_name') 
       ->from('employee') 
       ->limit(1); 
return $this->datatables->generate(); 

또 다른 방법

$this->datatables->select('employee_name'); 
$this->datatables->from('employee'); 
$this->datatables->limit(1); 
return $this->datatables->generate(); 
+0

귀중한 답장을 보내 주셔서 감사합니다. 나는 두 가지 코드를 시도했다. 그러나 "정의되지 않은 메소드 Datatables :: limit()"호출 오류가 발견되었습니다. – user3392207

관련 문제