高手请指教

ahbbdbc ahbbdbc 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想把数据库数据调成2个部分,请问循环语句该怎么写啊? ?
<table width="590" height="179" border="0" align="center" cellpadding="3" >
<%RecCount = objRS.RecordCount
if RecCount < 1 then Response.Write("暂无分类<br>")
%>
<%do while RecCount > 0%>
<%for i = 0 to 2 : tmpid(i) = NULL : next%>
<tr>
<td width="33%" valign="top"><p align="left"><b><a href="fenlei.asp?sortid=<%=objRS("ID")%>" title="<%=objRS("description")%>"><%=objRS("sortName")%></a></b></p></td>
<%tmpid(0) = objRS("ID") : objRS.MoveNext() : RecCount = RecCount - 1%>
<td width="33%" valign="top"><%if RecCount > 0 then%>
<p align="left"><b><a href="fenlei.asp?sortid=<%=objRS("ID")%>" title="<%=objRS("description")%>"><%=objRS("sortName")%></a></b></p>
<%tmpid(1) = objRS("ID") : objRS.MoveNext() : RecCount = RecCount - 1%>
<%end if%></td>
<td width="34%" valign="top"><%if RecCount > 0 then%>
<p align="left"><b><a href="fenlei.asp?sortid=<%=objRS("ID")%>" title="<%=objRS("description")%>"><%=objRS("sortName")%></a></b></p>
<%tmpid(2) = objRS("ID") : objRS.MoveNext() : RecCount = RecCount - 1%>
<%end if%></td>
</tr>
<tr>
<td width="33%" class="0" valign="top"><%
sql = "select * from shortcut where rootID = " & tmpid(0)
Set objShortCut = objConn.Execute(sql)
do while not objShortCut.EOF
%>
<a href="fenlei.asp?sortid=<%=objShortCut("sortID")%>" title="<%=objShortCut("description")%>"><%=objShortCut("sortName")%></a> 
<%objShortCut.MoveNext%>
<%loop%>
</td>
<td width="33%" class="0" valign="top"><%
if not IsNull(tmpid(1)) then
sql = "select * from shortcut where rootID = " & tmpid(1)
Set objShortCut = objConn.Execute(sql)
do while not objShortCut.EOF
%>
<a href="fenlei.asp?sortid=<%=objShortCut("sortID")%>" title="<%=objShortCut("description")%>"><%=objShortCut("sortName")%></a> 
<%objShortCut.MoveNext%>
<%loop%>
<%end if%>
</td>
<td width="34%" class="0" valign="top"><%
if not IsNull(tmpid(2)) then
sql = "select * from shortcut where rootID = " & tmpid(2)
Set objShortCut = objConn.Execute(sql)
do while not objShortCut.EOF
%>
<a href="fenlei.asp?sortid=<%=objShortCut("sortID")%>" title="<%=objShortCut("description")%>"><%=objShortCut("sortName")%></a> 
<%objShortCut.MoveNext%>
<%loop%>
<%end if%>
</td>
</tr>
<tr>
<td width="33%" height="10" colspan="3"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="4"></td>
</tr>
</table></td>
</tr>
<%loop%>
</table>
...全文
评论
收藏 已收藏
分享
返回顶部
ahbbdbc
ASP 28,401 成员 356,940 内容