sql = "select * from main order by id desc"帮我解释一下这段代码?
<%sql="select*frommainorderbyiddesc"setrs=server.createobject("adodb.recordset")rs.op...
<%
sql = "select * from main order by id desc"
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.recordcount >0 then
rs.pagesize=10
total = rs.pagecount
if cint(request.querystring("page")) < 1 then
page = 1
else
page = cint(request.querystring("page"))
end if
if page > total then
page = total
end if
rs.absolutepage = page
i=1
do while not rs.eof and not rs.bof
i=i+1 展开
sql = "select * from main order by id desc"
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.recordcount >0 then
rs.pagesize=10
total = rs.pagecount
if cint(request.querystring("page")) < 1 then
page = 1
else
page = cint(request.querystring("page"))
end if
if page > total then
page = total
end if
rs.absolutepage = page
i=1
do while not rs.eof and not rs.bof
i=i+1 展开
推荐于2018-05-14
展开全部
sql = "select * from main order by id desc" //按id从大到小查询表main
set rs = server.createobject("adodb.recordset")//数据源
rs.open sql,conn,1,1 //打开并查询
if rs.recordcount >0 then //当读取行大于0
rs.pagesize=10 //每页显示10个
total = rs.pagecount //把页码复值给total
if cint(request.querystring("page")) < 1 then //当为首页
page = 1 //定义page为1
else //否则
page = cint(request.querystring("page")) //page为当前页数
end if //结束
if page > total then //判断是否位末页
page = total //
end if
rs.absolutepage = page
i=1
do while not rs.eof and not rs.bof //开始循环读取数据
i=i+1 //定义变量开始提增
set rs = server.createobject("adodb.recordset")//数据源
rs.open sql,conn,1,1 //打开并查询
if rs.recordcount >0 then //当读取行大于0
rs.pagesize=10 //每页显示10个
total = rs.pagecount //把页码复值给total
if cint(request.querystring("page")) < 1 then //当为首页
page = 1 //定义page为1
else //否则
page = cint(request.querystring("page")) //page为当前页数
end if //结束
if page > total then //判断是否位末页
page = total //
end if
rs.absolutepage = page
i=1
do while not rs.eof and not rs.bof //开始循环读取数据
i=i+1 //定义变量开始提增
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询