I created a Google chart, and I added data taken from the database itself. However, getting data through php loops I had some difficulties because I couldn’t change this data to a diagram because of its syntax.
This is how far I left. I need to get mysql values instead:
1170, 460, 45, 123, 456], 660, 1120, 145, 785, 658]
var data = google.visualization.arrayToDataTable([ ['Term', <?php while ($getchartrows = mysql_fetch_array($getchart)) { echo " ' " . $getchartrows['std_ID'] . " ' " . ","; } ?>], <?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); ?> ['01', <?php echo $getone ['marks']; ?>, 400, 495, 565, 415], ['02', 1170, 460, 45, 123, 456], ['03', 660, 1120, 145, 785, 658] ]); var options = { title: 'Class Progress' };
source share