怎么在后台拼接easyui tree格式的json数据
1个回答
展开全部
include 'conn.php';
$result = array();
$rs = mysql_query("select * from nodes order by id desc");
while($row = mysql_fetch_array($rs)){
$node = array();
$node['id'] = $row['id'];
$node['text'] = $row['text'];
$node['state'] = $row['state'];
array_push($result,$node);
}
echo json_encode($result);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询