用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2260|回复: 0
收起左侧

帮我看看 我的link 始终在1 但是数据会改变

[复制链接]
发表于 2009-11-5 10:31:30 | 显示全部楼层 |阅读模式
function fenye2(){
$query=$this->db->query("select * from help_keyword");
$num=$query->num_rows();
$this->load->library('pagination');
$url_this = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; echo $url_this;//得到当前的url 地址
$arr=explode("=",$url_this);
echo $id=$arr[1];
$config['base_url'] = 'http://127.0.0.1/ufanju2/index.php/fenye/fenye2/';
$config['total_rows'] =$query->num_rows();
$config['per_page'] = '21';
$config['uri_segment'] = '6';
$config['num_links'] = ceil($config['total_rows']/$config['per_page']);
$config['last_link'] = iconv('','utf-8','末页');
$config['first_link'] = iconv('','utf-8','第一页');
$config['next_link'] = iconv('','utf-8','下一页');
$config['prev_link'] =  iconv('','utf-8','上一页');
$config['cur_tag_open'] = '<b>';
$config['cur_tag_close'] = '</b>';
$config['page_query_string'] = TRUE;
$config['query_string_segment'] = 'id';
print $per=$config['per_page'];
$start=$id-$per;
if($start <= -1)
{
$start=0;
}
?>
<div style="background-color:#00FFCC">
<?php
$query=$this->db->query("select * from help_keyword limit $start,$per");
foreach($query->result() as $row)
{
echo $row->name."<br>";
}
?>
</div>
<?php
$this->pagination->initialize($config);
$this->load->view('blogview');
echo $this->pagination->create_links();
}

本版积分规则