分页过程中遇到的问题,高分求解!!人在随时给分!
如下是我调用的部分,可以实现分页!数据库条数,页数等等返回的值也是对的!
只有一部分不对,也是问题的所在,我举个例子在下面:(假设有8条记录,每页显示5条,这样会分2页出来)
--------这是第一页内容---------(注意记录显示的顺序和记录的内容!)
1.aaaaaaa
2.bbbbbbb
3.ccccccc
4.ddddddd
5.eeeeeee
-------------------------------
--------这是第二页内容---------(注意记录显示的顺序和记录的内容!)
1.aaaaaaa
2.bbbbbbb
3.ccccccc
-------------------------------
在第二页中记录个数是对的,但是内容有问题!重复了第一页中的前3条记录!确显示应该是如下这样的:
6.fffffff
7.ggggggg
8.hhhhhhh
就是这样的问题,由于使用了上面的分页类,小弟对类还不是很熟悉,所以请高手帮忙看一眼,高分相送!人在可以立即给分!
<%
dim rsphoto,photosql
set rsphoto = server.createobject("adodb.recordset")
photosql = "select pid,title from photo where cid=" & id & " order by pid desc"
rsphoto.open photosql,conn,1,1
if rsphoto.eof then
response.write("<font color=""red"">暂时还没有图片!</font>")
else
dim a,totallist,listlimit,pagelists,i
set a = new pagelist
totallist = rsphoto.recordcount
listlimit = 8
pagelists = 2
a.initpara = array(totallist,listlimit,pagelists)
a.pagelist()
for i = a.getstart to a.getend
response.write("<li><a href=""photo.asp?cid=" & id & "&pid=" & rsphoto("pid") & "&" & okey & """>" & gottopic(rsphoto("title"),30) & "</a></li>")
rsphoto.movenext
next
response.write a.pageinfo
rsphoto.close
set rsphoto = nothing
end if
%>