多功能小型旋耕机价格:100分求助 asp 相关商品显示2列 高分求助!!

来源:百度文库 编辑:神马品牌网 时间:2024/05/04 08:00:23
原文件显示1列 现要显示2列 求助
。。。。。。。。。。。。。。。。。。。。
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<%
sorts2=gjz
sorts2=trim(sorts2)
if sorts2<>"" then
bsort2=split(sorts2,",")
for i=0 to ubound(bsort2)
bsortb2=bsort2(i)
bsortb2=trim(bsortb2)
x=0
shopList=6
set rs1=server.createobject("adodb.recordset")
sql="select * from shop_snsn where shopname<>'"&shopname&"' and shopcontent like '%"&bsortb2&"%' "
rs1.Open sql,conn,1,1
do while not rs1.eof
x=x+1
%>
<TR>
<TD VALIGN="top" HEIGHT="22" ><A HREF="list.asp?id=<%=rs1("shopid")%>"><img src="<%=trim(rs1("zhuang"))%>" width=80 border=0 height="60" title=" ● 艺人:<%=trim(rs1("cjname"))%>
● 专辑:<%=trim(rs1("shopname"))%>
● 状态:<%if rs1("kucun")>0 then%>上架
<%else%>暂时缺货 <%end if%> "></A></TD>
</TR><tr>
<td height="1" colspan="2" class="td_margin1"><img src="img/lf_directgo_boxdotline.gif" width="149" height="1"></td>
</tr>
<%
if x>=shopList then exit do
rs1.movenext
loop
rs1.close
next
end if
%>
</TABLE>

<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<%
sorts2=gjz
sorts2=trim(sorts2)
if sorts2<>"" then
bsort2=split(sorts2,",")
for i=0 to ubound(bsort2)
bsortb2=bsort2(i)
bsortb2=trim(bsortb2)
x=0
shopList=6
set rs1=server.createobject("adodb.recordset")
sql="select * from shop_snsn where shopname<>'"&shopname&"' and shopcontent like '%"&bsortb2&"%' "
rs1.Open sql,conn,1,1
do while not rs1.eof
x=x+1
%>
<TR>
<TD VALIGN="top" ><A HREF="list.asp?id=<%=rs1("shopid")%>"><img src="<%=trim(rs1("zhuang"))%>" width=80 border=0 height="60" title=" ● 艺人:<%=trim(rs1("cjname"))%>
● 专辑:<%=trim(rs1("shopname"))%>
● 状态:<%if rs1("kucun")>0 then%>上架
<%else%>暂时缺货 <%end if x=x+1%> "></A></TD>
<TD VALIGN="top" ><A HREF="list.asp?id=<%=rs1("shopid")%>"><img src="<%=trim(rs1("zhuang"))%>" width=80 border=0 height="60" title=" ● 艺人:<%=trim(rs1("cjname"))%>
● 专辑:<%=trim(rs1("shopname"))%>
● 状态:<%if rs1("kucun")>0 then%>上架
<%else%>暂时缺货 <%end if%> "></A></TD>
</TR>
<%
if x>=shopList then exit do
rs1.movenext
loop
rs1.close
next
end if
%>
</TABLE>

<%set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="4"></td></tr>
<tr>
<%j=1
do while rs.eof=false%>
<td height="25" valign="bottom">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="4"></td></tr>
<tr><td width="33%" align="center" ><img border=0 onload='DrawImage(this)' src="<%=rs("pic")%>"></td></tr>
<tr><td height="4"></td></tr>
<tr><td width="33%" align="center"><input name="pid" type="checkbox" value="<%=rs(0)%>"> 图片名称:<%=rs("topic")%></td></tr>
<tr><td height="5"></td></tr>
</table>
</td>
<%if j mod 2 = 0 then%></tr><tr><%end if%>

<%
j=j+1
rs.movenext
loop
%>
</table>

用一个判断,是否要加</tr><tr>
比如如果两列,那么就If I Mod 2 = 0 Then
三列If I Mod 3 = 0 Then