function news()
  {
  if($_GET['per_page']=="")
    {
      $start_limit=0;
    }else{
     $start_limit=$_GET['per_page'];
    }
 
    //如果不支持$_GET  那么就换成$_REQUEST来接收参数
    $query=$this->db->get('tabel');
    $num=$query->num_rows();
    $conf['per_page']=20;//每页显示数
    $conf['total_rows']=$num;//总共多少行
    $conf['base_url']=site_url()."/news";
    /*
    这样分页的连接就变成了 域名/news?per_page=xxx
    per_page 默认参数 如果想更改请添加
    $conf['query_string_segment']=你要的参数名比如page
    这样开始接收参数也要变成$_GET['page']
    然后分页连接就变成了域名/news?page=xxx
    */ 
    $conf['page_query_string'] = TRUE;  //开GET分页
    $conf['prev_link']="上一页";
    $conf['next_link']="下一页";
    $conf['first_link']="首页";
    $conf['last_link']="尾页";
    $conf['num_links']=5;
    $this->load->library('pagination',$conf);
    $links=$this->pagination->create_links();
    //每页查询开始
    $res1=$this->db->get('tabel',每页几条记录也就是取几条数据,从第几条开始查询这里是接收过来的参数$start_limit);        
    $res=$res1->result();