[eluser]Was[/eluser]
Hello,
here is the my products listing code and i m not using any cache method.
function products($page=0)
{
$config['base_url'] = base_url().'index.php/admin/products/';
$config['total_rows'] =$this->common->numberofrecord("*","products","");
$config['per_page'] =30;
$config['uri_segment']=3;
$this->pagination->initialize($config);
$data_common=$this->common->fetchdata("*","products","","order by id desc",$page,$config['per_page']);
$data['data_common']=$data_common;
if($this->session->userdata('admin_id')!='')
{
$this->load->view('admin/header');
$this->load->view('admin/products',$data);
$this->load->view('admin/footer');
}
else
{
redirect('admin','');
}
}
and this is the common query which i have written in models for fetching the data
function fetchdata($fieldname,$tblname,$where,$orderby,$page,$max)
{
$query=$this->db->query("select ".$fieldname." from ".$tblname." ".$where." ".$orderby." limit $page,$max");
$data=$query->result_array();
return $data;
}
thanx
Was