posts - 23, comments - 6, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          兩個表的雙循環排列

          Posted on 2006-09-18 14:29 小傻 閱讀(239) 評論(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%>


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 建湖县| 湘阴县| 章丘市| 新田县| 陆良县| 顺义区| 邢台市| 手机| 特克斯县| 灌南县| 南和县| 梁河县| 曲阜市| 贵溪市| 高邑县| 灵璧县| 临泽县| 卫辉市| 青龙| 伊川县| 股票| 莒南县| 定日县| 平山县| 克东县| 九江县| 县级市| 富裕县| 清水河县| 屯昌县| 赣州市| 临朐县| 东辽县| 即墨市| 和顺县| 沅陵县| 巴彦县| 若羌县| 凤冈县| 柘城县| 广西|