Posted on 2006-09-18 14:29
小傻 阅读(233)
评论(0) 编辑 收藏 所属分类:
asp
<TABLE >
<% set rs=server.createobject("adodb.recordset")
sql="select category.categoryid as id,category.categoryname as cname,classid,classname,classnumber from category,class where category.categoryid=class.categoryid order by category.sortnumber "
rs.open sql,conn,1,1
i=0
while not rs.eof
if i mod 3=0 then%>
<TR>
<%end if
id=rs("id")
id1=rs("id") %>
<TD vAlign=top>
<TABLE >
<tr>
<Td <%=trim(rs("cname"))%></A>
</Td>
</tr>
<tr>
<td>
<TABLE >
<%while not rs.eof and id1=id%>
<TR>
<TD >
<%=rs("classname")%></TD>
</TR>
<% rs.movenext
if not rs.eof then
id1=rs("id")
end if
wend%>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
<% i=i+1
if i mod 3=0 then%>
</TR>
<%end if
wend%>