asp mysql 倒序排列_ASP数据库排序

"id"andpagt<>"yhname"andpagt<>"CultureType"andpagt<>"LivestockType"andpagt<>"newtime"the...

pagt=request.QueryString("pagt")

if pagt="" and pagt<>"id" and pagt<>"yhname" and pagt<>"CultureType" and pagt<>"LivestockType" and pagt<>"newtime" then

page="newtime"

end if

%>

 
ID用户名养殖类型畜别注册时间

set rs=server.CreateObject("adodb.recordset")

rs.open "select * from yh order by '"&pagt&"' desc",conn,1,1

if rs.eof then

%>

暂时没有添加内容

else

nowpage=request.QueryString("nowpage")

if nowpage="" or nowpage<1 then nowpage=1

if not rs.eof then

page_U=10 '每页显示记录数,由此修改

rs.pagesize=page_U

rs.absolutepage=nowpage

end if

n=1

do while (not rs.eof) and n<=page_U

%>

rs.movenext

n=n+1

loop

%>

共有记录 条 | 第 页 | 共

=rs.pagecount%> 页 | - ?nowpage=1">

首页-

0 then%>

?nowpage=">上一页

if (nowpage+1)<=rs.pagecount then%>

?nowpage=">下一页

?nowpage=">末页

end if

rs.Clone

set rst=nothing

%>

如果把rs.open "select * from yh order by '"&pagt&"' desc",conn,1,1 里的'"&pagt&"'换成主键就可以,为什么用 pagt=request.QueryString("pagt")地址栏传参的方法据不行了呢,帮忙啊~~!

那里都好了,就是以主键排序不行,把rs.open "select * from yh order by '"&pagt&"' desc",conn,1,1 换成rs.open "select * from yh order by 主键 desc",conn,1,1

却可以,用测试request.QueryString方法也正确

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值