ASP+sql 双循环问题,高手进来救命! 5
<%rs.open"select*frombankuai",conn,1,1dowhilenotrs.eof%><tablewidth="78%"height="130"...
<%
rs.open "select* from bankuai",conn,1,1
do while not rs.eof
%>
<table width="78%" height="130" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="3%" height="28"><img src="image/3-1.gif" width="26" height="27"></td>
<td width="94%" background="image/2.jpg" class="STYLE5"><img src="image/7.gif" width="26" height="26">¤≡<%=rs("bk_name")%>≡¤</td>
<td width="3%"><img src="image/3-2.gif" width="26" height="27"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="71" valign="top">
<% id=request.querystring("id")
rs.open "select * from xiaoban",conn,1,1
do while not rs.eof
%>
<table width="100%" height="71" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" height="69"> <img src="image/1.gif" width="25" height="25"></td>
<td width="60%"><p><a href="gonggao.asp"><%=rs("xb_name")%></a><br>
<%=rs("xb_beiz")%><br>
斑竹:<% if rs("xb_banz")="" then%>空缺<%else%><%=rs("xb_banz")%><%end if%></p>
</td>
<td width="32%">新帖:<br>
用户:<br>
时间:</td>
</tr>
</table>
<%
rs.movenext
loop
%>
</td>
</tr>
<tr>
<td height="30"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%"><img src="image/4-1.gif" width="80" height="19" align="top"></td>
<td width="80%" background="image/1.jpg"> </td>
<td width="10%" align="right"><img src="image/4-2.gif" width="78" height="19"></td>
</tr>
</table></td>
</tr>
</table>
<%
rs.movenext
loop
%>
上面是错的,请问在第二个do while not rs.eof 循环中应该怎么做?才能把这个版块的ID和另外一个版块的所属ID一起查询出来? 展开
rs.open "select* from bankuai",conn,1,1
do while not rs.eof
%>
<table width="78%" height="130" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="3%" height="28"><img src="image/3-1.gif" width="26" height="27"></td>
<td width="94%" background="image/2.jpg" class="STYLE5"><img src="image/7.gif" width="26" height="26">¤≡<%=rs("bk_name")%>≡¤</td>
<td width="3%"><img src="image/3-2.gif" width="26" height="27"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="71" valign="top">
<% id=request.querystring("id")
rs.open "select * from xiaoban",conn,1,1
do while not rs.eof
%>
<table width="100%" height="71" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" height="69"> <img src="image/1.gif" width="25" height="25"></td>
<td width="60%"><p><a href="gonggao.asp"><%=rs("xb_name")%></a><br>
<%=rs("xb_beiz")%><br>
斑竹:<% if rs("xb_banz")="" then%>空缺<%else%><%=rs("xb_banz")%><%end if%></p>
</td>
<td width="32%">新帖:<br>
用户:<br>
时间:</td>
</tr>
</table>
<%
rs.movenext
loop
%>
</td>
</tr>
<tr>
<td height="30"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%"><img src="image/4-1.gif" width="80" height="19" align="top"></td>
<td width="80%" background="image/1.jpg"> </td>
<td width="10%" align="right"><img src="image/4-2.gif" width="78" height="19"></td>
</tr>
</table></td>
</tr>
</table>
<%
rs.movenext
loop
%>
上面是错的,请问在第二个do while not rs.eof 循环中应该怎么做?才能把这个版块的ID和另外一个版块的所属ID一起查询出来? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询