天空是藍色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
          數據加載中……
          記一段代碼[PHP]迭代讀取數據庫


          <style>

          input, select {
          ?font-size: 14px;
          ?color: #333333;
          ?padding-left:3px;
          ?background:#f6f6f6;
          ?border: #CCCCCC 1px solid;}
          </style>
          <?php
          require_once dirname(__FILE__) ."/headers.php";

          $i = 0;
          ??

          function category($category_parent_timestamp){
          ???global $db;
          ???global $i;
          ???$result = $db->get("{category_parent_timestamp} == " . $category_parent_timestamp,null,"categories",false,"category_time","desc");
          ???sort($result);
          ??
          ???for($index=0;$index<count($result);$index++){??????????
          ?????echo "<option>";
          ?????for($x=0;$x<$i;$x++){
          ???????echo "--";
          ??????}??????
          ?????echo $result[$index]['category_title'];
          ?????echo "&nbsp;";??
          ?????$sub = $db->get("{category_parent_timestamp} == " .$result[$index]['category_timestamp'],null,"categories",false,"category_time","desc");
          ?????if(count($sub)!=0){
          ???????$i++;
          ???????category($result[$index]['category_timestamp']);//迭代??????
          ???????$i--;
          ?????}
          ?????echo "</option>";
          ???}
          ???
          }????
          ?
          echo "<select>";
          category("0");?
          echo"</select>";
          ?>

          posted on 2006-06-23 00:09 bluesky 閱讀(2967) 評論(2)  編輯  收藏 所屬分類: PHP

          評論

          # re: 記一段代碼[PHP]迭代讀取數據庫 2006-07-03 04:49 阿亮

          這么多全都要么?還是什么?復制好后把代碼放到哪了又要應該注意哪些問題的?
          謝謝回答我的菜問題!
            回復  更多評論    

          # re: 記一段代碼[PHP]迭代讀取數據庫 2016-06-14 15:01 http://www.calvin-studio.fr

          請賜教!非常感激!
            回復  更多評論    
          主站蜘蛛池模板: 潢川县| 东港市| 土默特右旗| 赞皇县| 牟定县| 灵丘县| 华容县| 芜湖县| 诏安县| 象山县| 安丘市| 宜兴市| 汕尾市| 沈丘县| 三穗县| 岳西县| 重庆市| 离岛区| 溧阳市| 宿迁市| 晋江市| 开原市| 宝清县| 鄂伦春自治旗| 深圳市| 余江县| 仲巴县| 南雄市| 邳州市| 六枝特区| 澄江县| 颍上县| 宜川县| 汤原县| 鹤庆县| 襄垣县| 朝阳县| 平顶山市| 石棉县| 龙游县| 巴青县|