标签:cti order 技术 mysq return array img bsp lod
<?php
header("Content-type: text/html; charset=utf-8");
include(‘./db_mysql.php‘);
    /**全路径无限极
     * [index description]
     * @return [type] [description]
     */
    function index(){
        $sql = "SELECT id,catename,path,concat(path,‘,‘,id) as fullpath FROM recursions ORDER BY fullpath asc";
        $sq = mysql_query($sql);
        $arr = array();
        while ($sqls = mysql_fetch_assoc($sq)) {
            $dd = count(explode(‘,‘,trim($sqls[‘fullpath‘],‘,‘)) );
            $sqls[‘catename‘] = str_repeat(‘  ‘, $dd).‘|~~‘.$sqls[‘catename‘];
            $arr[] = $sqls;
        }
        return $arr;
    }
    $data = index();
    echo "<select>";
    foreach ($data as $key => $val) {
        echo "<option>{$val[‘catename‘]}</option>";
    }
    echo "</select>";
?>

标签:cti order 技术 mysq return array img bsp lod
原文地址:http://www.cnblogs.com/guishugan/p/6184588.html