我要调用classid 3的数据在主页显示,只显示6条,应该怎么办。
下面是调用该数据的代码,该怎么修改。
<%set rs=conn.execute("select * from news where classid=3" )do while not rs.eof%> <tr> <td height="30" align="left" style="line-height:20px;letter-spacing:2px;"> <a href="newsinfo.asp?id=<%=rs("id")%>"><%=rs("title")%></a> </td> <td style="color:#FF0000;" align="right">[<%=rs("addtime")%>] </td> </tr> <% rs.movenextloop rs.closeset rs=nothing%>
只选择前六条可否,
<%set rs=conn.execute("select top 6 * from news where classid=3" )do while not rs.eof%> <tr> <td height="30" align="left" style="line-height:20px;letter-spacing:2px;"> <a href="newsinfo.asp?id=<%=rs("id")%>"><%=rs("title")%></a> </td> <td style="color:#FF0000;" align="right">[<%=rs("addtime")%>] </td> </tr> <% rs.movenextloop rs.close set rs=nothing%>请采纳!