I change code but it stil not work:(
<?php
$conn = mysql_connect("localhost","root","") or die ('Error connecting to 
mysql');
mysql_select_db("rpmproject", $conn);
$int_y_pos = -1; 
$int_y_step_small = 1;
$sql = "SELECT * FROM diabetes WHERE Patient_ID ='123456789' ORDER BY 
Date_of_Measure DESC LIMIT 7"; 
$sql = mysql_query($sql);
$rownum = mysql_num_rows($sql);
?> 
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" 
src="http://www.google.com/jsapi";></script>
    <script type="text/javascript">
      google.load('visualization', '1', {packages: ['table']});
    </script>
    <script type="text/javascript">
    function drawVisualization() {
      // Create and populate the data table.
      var data = new google.visualization.DataTable();
        data.addColumn('date', 'Date_of_Measure');
        data.addColumn('number', 'BloodGlucose');
<?php
echo "  data.addRows($rownum);\n";
while($row = mysql_fetch_assoc($sql)) {
        $int_y_pos += $int_y_step_small; 
        echo "     data.setCell(" . $int_y_pos . ", 0,'". 
$row['Date_of_Measure']  . "');\n"; 
        echo "     data.setCell(" . $int_y_pos . ", 1,'" . 
$row['BloodGlucose']  . "');\n"; 
} 

?> 
 // Create and draw the visualization.
      visualization = new 
google.visualization.Table(document.getElementById('table'));
      visualization.draw(data, null);
    }


    google.setOnLoadCallback(drawVisualization);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="table"></div>                  
  </body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to