| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 743 人关注过本帖
标题:怎样使某几个大类显示在同一个页面
只看楼主 加入收藏
zallen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-13
收藏
 问题点数:0 回复次数:5 
怎样使某几个大类显示在同一个页面
本人ASP几乎文盲,只懂简单HTML.
麻烦回答详细一些,谢谢帮忙

好比我只想显示大类的
.asp?lx=big&anid=21
.asp?lx=big&anid=22
.asp?lx=big&anid=23
.asp?lx=big&anid=24 不现实所有大类的内容
是不是在下面这个ASP里面改数据呢?


<%'开始分页
Const MaxPerPage=15
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
dim anid
anid=split(request("anid"),"|")
set rs=server.CreateObject("adodb.recordset")
if anid="" then
rs.open "select * from shop_books order by adddate desc",conn,1,1
else
rs.open "select * from shop_books where anclassid="&anid&" order by adddate desc",conn,1,1
end if
if err.number<>0 then
response.write "数据库中无数据"
end if

if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,暂时还没有任何信息!</p>"
else
totalPut=rs.recordcount

if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if

if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"product.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"product.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"product.asp"
end if
end if
end if

sub showContent
dim i
i=0

%>
搜索更多相关主题的帖子: 页面 
2008-10-13 18:54
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
Select xxx From yyy Where Category=15

==>

Select xxx From yyy Where Category in (0,1,2,3,4,5,6)
2008-10-13 19:21
zallen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-13
收藏
得分:0 
[bo][un]multiple1902[/un] 在 2008-10-13 19:21 的发言:[/bo]

Select xxx From yyy Where Category=15

==>

Select xxx From yyy Where Category in (0,1,2,3,4,5,6)



那是不是我需要改的语句是:
"select * from shop_books where [bo]anclassid="&anid&" [/bo]order by adddate desc"
我标红的地方是不是要改啊?
具体怎么改麻烦说详细点,非常感谢
2008-10-14 23:06
zallen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-13
收藏
得分:0 
2008-10-15 12:38
sunfishy
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:311
专家分:163
注 册:2007-6-29
收藏
得分:0 
如果客户端传过来的anid值是多项的

那么在SQL中就用in.

anclassid in "&anid&"
2008-10-15 14:36
wxm198427
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:3
帖 子:561
专家分:25
注 册:2008-6-30
收藏
得分:0 
回复 3# zallen 的帖子
应该这样吧:"select * from shop_books where anclassid='"&anid&"' order by adddate desc"
2008-10-15 14:43
快速回复:怎样使某几个大类显示在同一个页面
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014608 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved