ASP内容分两列显示

2024-12-30 20:57:49
推荐回答(1个)
回答1:

<%
dim sql,rsBigClass,rsSmallClass,rsImage
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * From BigClass",conn,1,3%>



<%
dim j
J=0
do while not rsBigClass.eof%>

<%IF j mod 2 =0 THEN%>

<%ELSE%>

<%
end if
End if
rsBigClass.movenext
J=J+1
loop%>









<%
set prod_img=server.CreateObject("adodb.recordset")
prod_img.open "select DefaultPicUrl,id from product where Elite = true and BigClassName='"&rsBigClass("BigClassName")&"' order by id asc",conn,1,3
if prod_img.recordcount>=1 then
response.Write("")
end if
prod_img.close
set prod_img=nothing
%>
" ><%=rsBigClass("BigClassName")%>


<%
set rsSmallClass=server.CreateObject("adodb.recordset")
rsSmallClass.open "Select * From SmallClass Where BigClassName='" & rsBigClass("BigClassName") & "'",conn,1,3
if not(rsSmallClass.bof and rsSmallClass.eof) then
do while not rsSmallClass.eof
%>

<%=rsSmallClass("SmallClassName")%> |

<%
rsSmallClass.movenext
loop
end if
rsSmallClass.close
set rsSmallClass=nothing

%>


<%IF j mod 2 =1 THEN %>

<%rsBigClass.close
set rsBigClass=nothing
call CloseConn()
%>