ASP新闻分类输出显示问题求解答
想调用新闻中某一个分类的新闻应该怎么修改这段代码??<%Setrs=server.CreateObject("adodb.recordset")sql="selectto...
想调用新闻中某一个分类的新闻应该怎么修改这段代码??
<%
Set rs = server.CreateObject("adodb.recordset")
sql = "select top 5 * from pf_news order by pf_news_order desc"
rs.Open sql, conn, 1, 1
Do While Not rs.EOF
Set rsc = server.CreateObject("adodb.recordset")
sql = "select * from pf_news_category where id = "&rs("pf_news_category")&""
rsc.Open sql, conn, 1, 1
%>
<li><span class="float_right"><%=formatdatetime(rs("pf_news_date"),2)%></span><a href="news_view.asp?id=<%=rs("ID")%>" title="<%=rs("pf_news_name")%>"><%=left(rs("pf_news_name"),25)%></a></li>
<%
rsc.Close
Set rsc = Nothing
rs.movenext
Loop
rs.Close
Set rs = Nothing
%> 展开
<%
Set rs = server.CreateObject("adodb.recordset")
sql = "select top 5 * from pf_news order by pf_news_order desc"
rs.Open sql, conn, 1, 1
Do While Not rs.EOF
Set rsc = server.CreateObject("adodb.recordset")
sql = "select * from pf_news_category where id = "&rs("pf_news_category")&""
rsc.Open sql, conn, 1, 1
%>
<li><span class="float_right"><%=formatdatetime(rs("pf_news_date"),2)%></span><a href="news_view.asp?id=<%=rs("ID")%>" title="<%=rs("pf_news_name")%>"><%=left(rs("pf_news_name"),25)%></a></li>
<%
rsc.Close
Set rsc = Nothing
rs.movenext
Loop
rs.Close
Set rs = Nothing
%> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询