找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 219|回复: 2

条件语句问题

[复制链接]
发表于 2010-1-16 23:59:58 | 显示全部楼层 |阅读模式 IP:江苏扬州
<!--PRO Begin-->
<%sql="select * from products"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write("Null")
else
rdcount=rs.recordcount
%>
<TABLE cellSpacing=0 cellPadding=0 width=190 border=0>
<TBODY>
<TR>
<%
dim tempstr
tempstr = -1
for i=1 to rdcount
if rs("type_id") <> tempstr then
tempstr = rs("type_id")
%>
<TD width=163>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width="170" border=0>
<TBODY>
<TR>
<TD height=120 align="center"><A href="prod.asp?product_id=<%=rs("product_id")%>&type_id=<%=replace(rs("type_id"),"&","_")%>"><%=rs("type_id")%></A>
<P align=center><A href="prod.asp?product_id=<%=rs("product_id")%>&type_id=<%=replace(rs("type_id"),"&","_")%>"><IMG src="images/<%=rs("product_photo")%>" border=0 width=100></A></P></TD></TR>
<TR>
<TD height=25>
<P align=center><A class=small href="prod.asp?product_id=<%=rs("product_id")%>&type_id=<%=replace(rs("type_id"),"&","_")%>">
<span style="font-size: 8pt; text-decoration: none"><%=rs("product_num")%></span></A></P></TD></TR>
<TR>
<TD> <TR>
<TD>
<table border="0" width=150 cellspacing="0" cellpadding="0" align=center>
<tr>
<td bgcolor="#000000" height=1></td>
</tr>
</table></TD>
</TR>
<TR>
<TD height=10></TD>
</TR><%
sql="select top 5 * from products where type_id='"&type_id&"' and product_id<>"&rs("product_id")&" order by product_date desc"
rs2.open sql,conn,1,1
rdcount2=rs2.recordcount
for j=1 to rdcount2
%>
<TR>
<TD height=20><IMG style="margin-left:10px" src="images/arrow_blk.gif" border=0><A class=navsublinks
href="prod_detail.asp?product_id=<%=rs2("product_id")%>&type_id=<%=replace(rs2("type_id"),"&","_")%>"><%=rs2("product_num")%></A></TD>
</TR>
<%
rs2.movenext
next
rs2.close
%>
<TR>
<TD height=20><IMG style="margin-left:10px" src="images/arrow_blk.gif" border=0><A href="prod.asp?product_id=<%=rs("product_id")%>&type_id=<%=replace(rs("type_id"),"&","_")%>"><img src="images/view_all.gif" border=0></A></TD>
</TR>
</TD></TR>
</TBODY></TABLE></DIV></TD>
<TD width=27 valign="top">
<table border="0" width="1" id="table1" cellspacing="0" cellpadding="0" bgcolor="#000000" height=140 align=center>
<tr>
<td bgcolor="#FFFFFF" width=1 height="7"></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</TD>
<%
end if
rs.movenext
if i mod 3 = 0 then response.write("</tr><tr><td height=30></td></tr><TR>")
next
end if
rs.close
%>
</TR>
</TBODY></TABLE>
<!--PRO End-->

现在这个页面如果同一个type_id的记录条数大于1,那么就会换行显示下一个type_id的内容
请问这一句if i mod 3 = 0 then response.write("</tr><tr><td height=30></td></tr><TR>")
如何调整,能够显示满3个type_id才换行
谢谢
发表于 2010-1-17 00:00:03 | 显示全部楼层 IP:江苏扬州
已经解决了~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 13:32 , Processed in 0.243905 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表