I am using Jquery Flot Chart for plotting charts. To pass the data to chart,I am getting data from the database, and then I need to pass that php array into javascript array. I am using json_encode($array),but it is not working.
$row=array();
while($res=mysql_fetch_array($exequery))
{
$row[]=$res[0];
}
Now,in the same file(without using ajax), I want to pass this php array to javascript array,which then will be used to plot chart.
<script src="jquery-1.8.3.min.js"></script>
<script src="jquer.flot.min.js"></script>
<script type ="text/javascript">
var dataArray=<?php echo json_encode($row)?>;
When I am using this, chart is getting disappeared and alert(dataArray) is also showing nothing. Please help.