Home  >  Article  >  Backend Development  >  这段代码为啥无法 加入链接

这段代码为啥无法 加入链接

WBOY
WBOYOriginal
2016-06-13 11:31:21605browse

这段代码为什么无法 加入链接啊



 
   New Document 
 

 
  $link   = mysql_connect( '127.0.0.1', 'root', '520928' ) or die( mysql_error() );//连接数据库服务器
          mysql_select_db( 'test' );//选择数据库
          mysql_set_charset( 'utf8' );//设置字符编码
 
             $sql = "SELECT * FROM wxtree";//查询分类表
          $result = mysql_query( $sql );
            $tree = array();//初始化一个数组
          while( $row  = mysql_fetch_assoc( $result ) )
                 {                   
                     $tree[$row['fid']][$row['id']]  = $row['cat_name'];//创建分类数组                                                  
                 }
          mysql_close( $link );//关闭数据库
  
        print_r($tree[02]);
echo '-------------------------------------------' . "\n";
 
//递归函数
  
function for_category( $arr = array(), $arr2 )
{  
    echo "
    ";
        foreach ( $arr as $k => $v )
        {   
            if ( isset( $arr2[$k] ) && is_array( $arr2[$k] ) )
            {  
                echo "
  • $k $v           W3School 添加  编辑   删除 " ;           
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn