我想让用户可以看到他们来自哪里以及有多少评论并按国家/地区分组:
这个对吗?
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Politics'],
<?php
$sql = mysql_query("SELECT country FROM comments WHERE userid = '$userid' AND GROUP BY country");
$output = "";
$countpeople = mysql_num_rows($sql);
while( $row = mysql_fetch_array($sql)){
}
echo $output;
?>
]);
var options = {'backgroundColor': '#E9F6FD'};
var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
</script>
有没有办法进行 SELECT SUM?
感谢您的帮助。