|
用了getrows提高效率
[U]复制代码[/U] 代码如下:
")
response.write("")
dim RssId,sql,rs,tid,rs_type,sql_type,sqqq,rsshow,thetitle,themon,theday,thedate,theyear
RssId=CheckStr(Request.QueryString("RSSID"))
if not IsInteger(RssId) then RssId=1
'得到子类别的所有id
set rsshow=conn.execute("select tname,counts,tid from infotype where id="&RSSID&"")
if not (rsshow.eof and rsshow.bof) then
thetitle=split(rsshow("tname"),"|")(rsshow("counts")-1)
tid=rsshow("tid")
end if
rsshow.close
set rsshow=nothing
set rs_type=server.CreateObject("ADODB.RecordSet")
sql_type="select id from infotype where tid like '"&tid&"%'"
rs_type.open sql_type,conn,1,1
do while not rs_type.EOF
sqqq=sqqq&rs_type("id")&","
rs_type.MoveNext
loop
rs_type.close
set rs_type=nothing
if sqqq="" then sqqq=tid
sql="select top 20 type_id,title,id,content,datetime,author from news where type_id in ("&sqqq&") and isshow=true order by datetime desc,id desc"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
redim feedcat(0,0)
else
feedrows=rs.getrows()
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
-脚本之家-www.jb51.net]]>
//www.jb51.net
zh-cn
jb51 2006
/html//.htm
]]>
"" and not isnull(FeedRows(3,i)) then
Response.Write("")
end if
%>
|
|