How to use limit correctly in Codeigniter Framework PHP -


in project want show 3 rows, use limit('3'), when result greater 3, content not showing.

if limit increase 3 5 or 6 items again start show.

how fixed problem, if item count more, shows 3?

here database code, written model:

public function select_all_contenta() {   $this->db->select('*');  $this->db->from('content');   $this->db->order_by('date_add','desc');  $this->db->limit('3');   $query_result=$this->db->get();  $allcontent_infoa=$query_result->result();  return $allcontent_infoa; } 

public function select_all_contenta() {    $this->db->from('content');    $this->db->order_by('date_add','desc');    $this->db->limit('3');    $query_result = $this->db->get();    $allcontent_infoa = $query_result->result_array();    return $allcontent_infoa; } 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -