1 Star 0 Fork 32

jeanzhou/家谱familytree

forked from jiehu0992/家谱familytree 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
connztree.php 594 Bytes
一键复制 编辑 原始数据 按行查看 历史
<?php
$mysqli = new mysqli ( 'localhost' , 'root' , 'root' , 'tree' );
mysqli_query($mysqli, "set names gbk");
if ( $mysqli -> connect_error ) {
die( $mysqli -> connect_errno + $mysqli -> connect_error );
}
$sql='select * from tree_lr';
$res=mysqli_query($mysqli, $sql);
$array=array();
while ($row=mysqli_fetch_row($res)){
$menu=array(
"id"=>$row[0],
"pId"=>$row[1],
"name"=>urlencode(iconv('gb2312','utf-8',$row[2])),
"open"=>1,
"file"=>$row[4],
);
array_push($array, $menu);
}
echo json_encode($array);
$mysqli -> close ();
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/jeanzhou/genealogy_familytree.git
git@gitee.com:jeanzhou/genealogy_familytree.git
jeanzhou
genealogy_familytree
家谱familytree
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385