easyui-dadagrid无法显示后台用php获取的json数据

后台获取的数据没有问题,如果保存为json文件,url中引用该文件可以显示。但直接在url中调用php文件就不显示。

显示代码:

<!DOCTYPE html>



用户管理







rownumbers="true" fitColumns="true" singleSelect="true" url="getUserList.php" method="get">











用户ID 用户姓名 口令 权限 电话 邮件


getUserList.php代码:
$conn=mysql_connect("localhost","root","2018cy1010") or die("连接失败");
mysql_select_db("hrinfo");
$rs = mysql_query('select * from tabuser');
$item = array();
$result["total"] = 4;

while($row = mysql_fetch_object($rs)){
array_push($item, $row);
}
$result["rows"] =$item;
$json=json_encode($result);

    echo $json;

¥jsonshu数据
{"total":3,"rows":[{"userid":"admin","username":"administrator","password":"88","privilege":"1111111111111111","telphone":"13812345678","email":"admin@neusoft.com"},{"userid":"guest","username":"guester","password":"22","privilege":"1000000000000000","telphone":"13800100200","email":"guest@neusoft.com"},{"userid":"system","username":"systemmgr","password":"root","privilege":"1111111111111111","telphone":"13800000001","email":"system@neusoft.com"}]}

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐