我正在尝试为我的网站每天获得的浏览量创建一个谷歌折线图。我不太确定该怎么做。
这是使一切正常的代码:
<html>
<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([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 5412]
]);
var options = {
title: 'Company Performance'
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
现在我想将其更改为列出每天对我的网站的总浏览量,然后将其与每天对我的网站的唯一浏览量进行比较。
查询看起来像:
$total = mysql_query("SELECT id, userID, ip, date FROM views WHERE userID!='1'");
$unique = mysql_query("SELECT id, userID, ip, date FROM views GROUP BY ip");