新闻有分类,你不该分成2个表的,1张表就够了,然后给表加上一个新闻类别的typeid字段,另外一张表是新闻类型,字段有id,newstypename,然后
<%
sql="select a.title,a.id,b.newstype as newstype from a.news,b.newstype where b.id=a.typeid"
rs.open sql,conn,1,1
while not rs.eof%>
[<%=rs("newstypename")%>]<a href="news_detail.asp?id=<%=rs("id")%>"><%=rs("newstitle")%></a>
<%
rs.movenext
wend
rs.close
%>
大概是这样。你可有自己试着再调下,我没调试过
温馨提示:答案为网友推荐,仅供参考