asp表格嵌套循环问题
<divstyle="height:109;width:980"><tablewidth="980"height="109"border="0"cellpadding="...
<div style="height:109; width:980">
<table width="980" height="109" border="0" cellpadding="0" cellspacing="0">
<tr>
<th height="106" background="images/btlywbj.gif" scope="col">
<%
set rscp=server.createobject("ADODB.recordset")
rscp.Open "select top 8 * from guanggao where lei='广告招商' order by id desc",conn,1,1
%>
<table width="240" height="54" border="0" cellpadding="0" cellspacing="3">
<%
tr=0
do while tr<2 and not rscp.eof
%>
<tr>
<%
td=0
do while td<4 and not rscp.eof
%>
<td width="240" height="50" scope="col"><table width="240" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="240" scope="col"><a href="<%=rscp("link")%>"><img src="guanggao/<%=rscp("uppic")%>" width="240" height="50" border="0"></a></th>
</tr>
</table></td>
<%
td=td+1
rscp.movenext
loop
%>
</tr>
<%
tr=tr+1
loop
%>
</table>
</th>
</tr>
</table></div>
此段代码单独方在页面中,页面可以显示,如果在其他页面中添加此段代码后后,页面无法显示。有哪位大侠可以帮我解决一下。谢谢!
rscp在最后也关闭了 展开
<table width="980" height="109" border="0" cellpadding="0" cellspacing="0">
<tr>
<th height="106" background="images/btlywbj.gif" scope="col">
<%
set rscp=server.createobject("ADODB.recordset")
rscp.Open "select top 8 * from guanggao where lei='广告招商' order by id desc",conn,1,1
%>
<table width="240" height="54" border="0" cellpadding="0" cellspacing="3">
<%
tr=0
do while tr<2 and not rscp.eof
%>
<tr>
<%
td=0
do while td<4 and not rscp.eof
%>
<td width="240" height="50" scope="col"><table width="240" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="240" scope="col"><a href="<%=rscp("link")%>"><img src="guanggao/<%=rscp("uppic")%>" width="240" height="50" border="0"></a></th>
</tr>
</table></td>
<%
td=td+1
rscp.movenext
loop
%>
</tr>
<%
tr=tr+1
loop
%>
</table>
</th>
</tr>
</table></div>
此段代码单独方在页面中,页面可以显示,如果在其他页面中添加此段代码后后,页面无法显示。有哪位大侠可以帮我解决一下。谢谢!
rscp在最后也关闭了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询