要做一個網(wǎng)站信息量分析,需要統(tǒng)計(jì)信息表里面各個欄目分類的信息數(shù),然后按高到低排列。
<% set rs=server.CreateObject("adodb.recordset") rs.open "select * from (select [c_name],(select count(*) as total from [wq_news] where [wq_classc].c_name=[wq_news].c_name) as pl_num from [wq_classc]) order by [pl_num] desc",conn,1,1 do while not rs.eof %> <div> <%=rs("c_name")%> <% dim IdNum set rs1=conn.Execute("select count(*) from wq_news where c_name='"&rs("c_name")&"'") IdNum=rs1(0) if isnull(Id) then IdNum=0 if not rs1.eof then %> <%=IdNum%> <% end if rs1.close set rs1=nothing %> </div> <% rs.movenext loop rs.close set rs=nothing %>
建站咨詢熱線
029-33273980