Skip to content
This repository was archived by the owner on Apr 9, 2023. It is now read-only.

Commit e100abb

Browse files
committed
Bugfix
1 parent 708390d commit e100abb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

statistics.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ function get_one_row($query, $mysql) {
4646
}
4747
$ttlrqtsr = get_one_row("SELECT COUNT(*) FROM requests;", $b1_analytics_db);
4848
$total_requests = $ttlrqtsr[0];
49+
if($total_requests == 0) {
50+
echo "Not enough data collected yet.<br>";
51+
echo "<a href=\"https://beranek1.github.io/webanalytics/\">b1 web analytics</a>";
52+
$b1_analytics_db->close();
53+
return;
54+
}
4955
$ttlvstrsr = get_one_row("SELECT COUNT(*) FROM uniquebrowsers;", $b1_analytics_db);
5056
$total_visitors = $ttlvstrsr[0];
5157
$ttlntwsr = get_one_row("SELECT COUNT(*) FROM networks;", $b1_analytics_db);

0 commit comments

Comments
 (0)