title: how to call just only data.addrow from database to google chart
body: <p>I got a Google Chart (column) that will call only the row from the database, and the column is defined by us. but I got a problem..the chart won't come out, can all of you see what is wrong with my source code..? thank u very much...!</p>
  
  <pre><code>    $query = "SELECT * FROM grouppercent where idmember = '$idmembersession' and iddocument = '$iddoc'";
      $sql_query = mysql_query($query) or die('Error 3 :'.mysql_error());
      while($row = mysql_fetch_array($sql_query))
      {
          $subtitle = $row['subject'];
          echo "Title: " . $subtitle;
      }
  
  ?&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;script src="http://code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;
  &lt;title&gt;SAM HISTOGRAM&lt;/title&gt;
  &lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  google.load('visualization', '1', { packages: ['corechart'] });
  function drawChart(json) 
  {
          data = new google.visualization.DataTable();
          data.addColumn('string', 'SD-ESD');
          data.addColumn('string', 'WEHAB');
          data.addColumn('string', 'CROSS SECTORIAL');
          &lt;?php
              foreach($row as $data)
               {
               echo "data.addRow( $data['resultsd'], $data['resultwe'], $data['resulttre'] );";
              }
  
  
          ?&gt;
          var options = 
          {
              title: 'SAM Histogram Results',
              hAxis: {title: 'Sustainability Percentage'}, 
              titleTextStyle: {color: 'black'},
          } 
  
          var chart = new google.visualization.ColumnChart(document.getElementById('visualization')).
          drawChart(data,options);  
  }
  
          google.setOnLoadCallback(drawChart);
  </code></pre>