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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -