只需要ASP代码要二行四列图片显示数据.可结果top 8 无效出来N多数据
下列代码出来成了三排,top8无效(数据库里仅11条,如果有多的还自动会插入更多),请问如何约束成只显示二排四行共8条数据?请高手帮帮忙,在网上遍寻无果,只有来百度知道了...
下列代码出来成了三排,top 8 无效(数据库里仅11条,如果有多的还自动会插入更多),请问如何约束成只显示二排四行共8条数据?
请高手帮帮忙,在网上遍寻无果,只有来百度知道了,财富值只有7,不然会多给的,有好的答复,我会在第一时间采纳的,谢谢了!
<td width="80%"><table width="727" height="249" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<%
theclass=1
sql_top_1="select top 8 * from tour where op_type like '%"&theclass&"%' and classid=1 order by hots asc"
set rs_top_1=Server.CreateObject("ADODB.Recordset")
rs_top_1.open sql_top_1,conn,1,1
if (rs_top_1.eof and rs_top_1.bof) then
response.write "<td height=25 colspan=5 rowspan=1>暂无内容</td>"
else
n=0
rs_top_1.movefirst
do while not rs_top_1.eof
n=n+1
%>
<td width="727" align="left" valign="top"><table width="138" height="70" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="138" height="70" align="center"><table width="177" height="117" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="177" height="117"><div id="div<%=rs_top_1("id")%>" class="ScenicSmall" onMouseMove="imageover('<%=rs_top_1("id")%>')" onMouseOut="imageout('<%=rs_top_1("id")%>')"> <a href="tour/show.asp?id=<%=rs_top_1("id")%>" target="_blank"> <img class="ScenicSmallImage" border="0" src="img/<%=rs_top_1("url")%>" /> </a>
<div style="FILTER: alpha(opacity=0); DISPLAY: block" id="<%=rs_top_1("id")%>" class="ScenicSmallImageDiv">
<div class="ScenicSmallImageFont"> <b><%=left(rs_top_1("name"),12)%></b> </div>
</div>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
<%if n mod 4=0 then response.write("</tr><tr align=center>")
rs_top_1.movenext
loop
end if
rs_top_1.close
set rs_top_1=nothing%>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table> 展开
请高手帮帮忙,在网上遍寻无果,只有来百度知道了,财富值只有7,不然会多给的,有好的答复,我会在第一时间采纳的,谢谢了!
<td width="80%"><table width="727" height="249" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<%
theclass=1
sql_top_1="select top 8 * from tour where op_type like '%"&theclass&"%' and classid=1 order by hots asc"
set rs_top_1=Server.CreateObject("ADODB.Recordset")
rs_top_1.open sql_top_1,conn,1,1
if (rs_top_1.eof and rs_top_1.bof) then
response.write "<td height=25 colspan=5 rowspan=1>暂无内容</td>"
else
n=0
rs_top_1.movefirst
do while not rs_top_1.eof
n=n+1
%>
<td width="727" align="left" valign="top"><table width="138" height="70" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="138" height="70" align="center"><table width="177" height="117" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="177" height="117"><div id="div<%=rs_top_1("id")%>" class="ScenicSmall" onMouseMove="imageover('<%=rs_top_1("id")%>')" onMouseOut="imageout('<%=rs_top_1("id")%>')"> <a href="tour/show.asp?id=<%=rs_top_1("id")%>" target="_blank"> <img class="ScenicSmallImage" border="0" src="img/<%=rs_top_1("url")%>" /> </a>
<div style="FILTER: alpha(opacity=0); DISPLAY: block" id="<%=rs_top_1("id")%>" class="ScenicSmallImageDiv">
<div class="ScenicSmallImageFont"> <b><%=left(rs_top_1("name"),12)%></b> </div>
</div>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
<%if n mod 4=0 then response.write("</tr><tr align=center>")
rs_top_1.movenext
loop
end if
rs_top_1.close
set rs_top_1=nothing%>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询