Chart creation in php and my sql using google visualization
<p>Hi am trying to create chart with the following query.</p>

<pre><code>    $sql_no=mysql_query("SELECT MONTH(calldate) AS month,COUNT(*) AS nosuccess FROM     details WHERE result =1 GROUP BY MONTH(cdate)");
   $call=mysql_fetch_assoc($sql_no);?&gt;
    &lt;?php
   While($call=mysql_fetch_assoc($sql_no)){
      $success[]=$call['nosuccess'];
      $monname[]=date( 'F', mktime(0, 0, 0,$call['month']) );   
      }
</code></pre>

<p>and here is my chart code:</p>

<pre><code>    var total = &lt;?php echo json_encode($total) ?&gt;;
var s=&lt;?php echo json_encode($success) ?&gt;;
var m=&lt;?php echo json_encode($monname) ?&gt;;
var d=3;

     var result=[];
     for(var i=0; i&lt;s.length; i++) {
      result.push([m[i],s[i]]);
     }     
    alert(result.length);

  google.load("visualization", "1", {packages:["corechart"]});
  google.setOnLoadCallback(drawChart);
  function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('date', 'Month');
    data.addColumn('number', 'Success');
   // data.addColumn('number', 'Failure');
  /*data.addRows([
      ['2004', 1000, 400],
      ['2005', 1170, 460],
      ['2006',  860, 580],
      ['2007', 1030, 540]
    ]);*/

 data.addRows(result);

    var options = {
      width: 800, height: 340,
      title: 'Call details'
    };

    var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
    chart.draw(data, options);
  }
</code></pre>

<p>chart is not displaying . when am hide the data.addrows(result); chart displays with no lines..did you find any errors help needed immediatly...</p>
