If your query returns more than or less than one row of data, you will have
an error because the HTML will be invalid. Open the page in a browser,
right click and view the source code, then post it here so I can see what
your server-side code is outputting.
As an aside, you have an errant comma at the end of this line:
['Semester 12', <?php echo $row[12] ?> ], <-- this comma
which will cause IE to throw a tantrum like a petulant two-year-old child
(IE does not like commas after the last item in an array). Remove the
comma so IE won't complain.
On Tuesday, November 19, 2013 10:16:37 PM UTC-5, cik oshin wrote:
>
> This is my code:
>
>
>
> <html>
> <?php
>
> mysql_connect("localhost","root","");
> mysql_select_db("sperformance");
>
>
>
>
> $query="SELECT * FROM stud_details WHERE email='[email protected]<javascript:>
> '";
> $result = mysql_query($query) or die ("Error in query: $query.
> ".mysql_error());
>
> while($row = mysql_fetch_row($result)) {
> ?>
>
> <head>
> <script type="text/javascript" src="https://www.google.com/jsapi
> "></script>
> <script type="text/javascript">
> google.load("visualization", "1", {packages:["corechart"]});
> google.setOnLoadCallback(drawChart);
> function drawChart() {
> var data = google.visualization.arrayToDataTable([
> ['x', 'CGPA' ],
> ['Semester 1', <?php echo $row[1] ?> ],
> ['Semester 2', <?php echo $row[2] ?> ],
> ['Semester 3', <?php echo $row[3] ?> ],
> ['Semester 4', <?php echo $row[4] ?> ],
> ['Semester 5', <?php echo $row[5] ?> ],
> ['Semester 6', <?php echo $row[6] ?> ],
> ['Semester 7', <?php echo $row[7] ?> ],
> ['Semester 8', <?php echo $row[8] ?> ],
> ['Semester 9', <?php echo $row[9] ?> ],
> ['Semester 10', <?php echo $row[10] ?> ],
> ['Semester 11', <?php echo $row[11] ?> ],
> ['Semester 12', <?php echo $row[12] ?> ],
>
> ]);
> var options = {
> title: 'Student Performance'
> };
>
> var chart = new
> google.visualization.LineChart(document.getElementById('chart_div'));
> chart.draw(data, options);
> }
> </script>
> </head>
> <body>
> <div id="chart_div" style="width: 1300px; height: 500px;"></div>
> </body>
> <?php
> }
> ?>
> </html>
>
>
>
>
> I don't know why the graph did not appear. Anyone can help me? Thank you.
>
--
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.
For more options, visit https://groups.google.com/groups/opt_out.