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

          兩個表的雙循環排列

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


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


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 南溪县| 湘西| 南京市| 洛隆县| 恩平市| 正定县| 镇雄县| 赤峰市| 德保县| 水富县| 乌鲁木齐县| 万安县| 永川市| 高雄县| 台南县| 秦安县| 威远县| 台江县| 常德市| 望奎县| 靖安县| 晋中市| 礼泉县| 武宣县| 东海县| 永靖县| 华安县| 铁岭县| 道真| 宁海县| 襄汾县| 东明县| 石林| 锡林浩特市| 泰兴市| 抚远县| 松滋市| 陆丰市| 萨迦县| 四川省| 马龙县|