Creating jqplot graph using php

痞子三分冷 提交于 2019-12-06 14:43:12

The problem is the format of your json data, which is coming from the (associative) $output array. you don't want those '"PER"'s in it! try replacing these lines of code:

while($e=mysql_fetch_assoc($q))
    $output[]=$e;

print(json_encode($output)); 

with these:

while($e=mysql_fetch_assoc($q))
    $output[]=$e["PER"];

print ('['.json_encode($output).']'); 

this will change $output from an associative array, to a standard array of integers.

and the print line adds additional square brackets around the json data - which the jqplot requires.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!