上一主题/下一主题的实现
$data['one_content'] = $this->content_model->get_ll($content_id);function get_ll($id){
if (!$id){
return array();
}
$query = $this->db->get_where('content',array('Id' => $id));
if ($row = $query->row_array()){
return $row;
}
return array();
}
我已经获取当前主题,想在页面上实现“上一主题/下一主题”应该怎么写 写一条额外sql语句,获取当前ID的上一个和下一个ID id>id order by id asc
id<id order by id desc
页:
[1]