title: How to get mysql data into a google chart using php loop?
body: <p>I've created a Google chart and I've added data taken from the database itself. When getting data through php loops though, I have had some difficulty because I couldn't amend that data to the chart because of its syntax.</p>
  
  <p>This is as far as I have gone. I need to get the mysql values in place of:<br><br> 1170,      460, 45, 123, 456],
                                              660,       1120, 145, 785, 658]  </p>
  
  <pre><code>    var data = google.visualization.arrayToDataTable([
        ['Term', &lt;?php
  
        while ($getchartrows =  mysql_fetch_array($getchart))
        {
            echo  " ' " . $getchartrows['std_ID'] . " ' " . ",";
        }
  
        ?&gt;],
  
        &lt;?php
  
  
        $one = mysql_query("SELECT * FROM stusitting WHERE std_ID = '0001' AND subjectNo = '$subin' AND grade = '$gradein' AND termNo = '$tcheck' ");
        $getone = mysql_fetch_array($one);
  
        ?&gt;
  
            ['01',  &lt;?php echo $getone ['marks']; ?&gt;,      400, 495, 565, 415],
        ['02',  1170,      460, 45, 123, 456],
        ['03',  660,       1120, 145, 785, 658]
      ]);
  
  
  
  
      var options = {
        title: 'Class Progress'
      };
  </code></pre>