Hallo
I'm running a simple webradio with spacialaudio SAM. This program stores datetime and listeners number among other data into a mysql table. Radio is onair from 8am to 8pm.
here is partial hystorylist table
Column Name | Datatype
date_played | DATETIME
listeners | MEDIUMINT(9)
I would like to show on a web page some data so to have an idea of how the radio is going
1. Avarage listeners from radio startup
2. Max listeners ever
and some more other:
1. monthly avarege listeners divided by "zone hours" displayed by year
(ie. how many listeners during the morning [9/12am] or the noon [3-6pm]
<< year 2008 >>
month | morning listeners | noon listeners
Gen | 25.2 | 19.3
Feb | 34.3 | 21.5
Mar | 18.1 etc...)
2.day avarege listeners divided by "zone hours" displayed by month
(ie. how many listeners during the morning [9/12am] or the noon [3-6pm]
<< Month June >>
day | morning listeners | noon listeners
Mon | 25.2 | 19.3
Tue | 34.3 | 21.5
Wen | 18.1 etc...)
I started writing some code:
$hour=16;
$minute=15;
$month="June";
mysql_db($database_radio, $radio);
$query_Chart = "SELECT ID, DAYNAME(date_played) as day, DATE_FORMAT(date_played, '%e %M') as dateplayed, date_played, listeners FROM historylist WHERE DATE_FORMAT(date_played, '%M') = '$month' AND HOUR(date_played) = '$hour' AND MINUTE(date_played) = '$minute' AND listeners > 0 ORDER BY date_played ASC";
as a starting point but have no clue on how to go on... (listeners >0 is to avoid 0 listeners for a relay fault which may happen sometime)
thanks
Johanna
Start Free Trial