天空是藍色的

          做好軟件為中國 #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 閱讀(2963) 評論(2)  編輯  收藏 所屬分類: PHP

          評論

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

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

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

          請賜教!非常感激!
            回復  更多評論    
          主站蜘蛛池模板: 罗山县| 咸宁市| 乐安县| 吐鲁番市| 中超| 山阳县| 任丘市| 开江县| 滦南县| 郎溪县| 光山县| 田林县| 水富县| 宁强县| 彭阳县| 兴隆县| 平乡县| 新乐市| 玛沁县| 榕江县| 惠水县| 通许县| 东阳市| 刚察县| 桂林市| 永丰县| 甘谷县| 万安县| 澄江县| 宝山区| 德保县| 海原县| 鞍山市| 嘉黎县| 托克托县| 绥江县| 平塘县| 苗栗县| 屯门区| 陇南市| 连云港市|