Daily Summary: Difference between revisions

778 bytes added ,  21:00, 11 April 2018
m
Line 190: Line 190:


== Displaying daily statistics from a database table ==
== Displaying daily statistics from a database table ==
=== Schema ===
Any script that reads from a database table needs two pre-requisites
# Something that loads the daily statistics into the database table - Functionality is included in Cumulus MX to do this either using the schema devised by Mark Crossley or your own
# The script needs to know the names of the columns it is to read from the database. Database designers talk about ''schema'' for the documentation that describes the design of the table, what the columns are called, and what type and size of variables they hold. For Cumulus 1, a script to create a database table, populate and update it from the daily summary log file is described in [[ImportCumulusFile|this Wiki article]]. There is some discussion in the forum about variants.
=== Some example Scripts ===
Look in the Website Development section of the Cumulus support forum - '''Web general''' sub forum:
Look in the Website Development section of the Cumulus support forum - '''Web general''' sub forum:
*[http://sandaysoft.com/forum/viewtopic.php?f=14&t=15983#p122552 SQL dayfile data Viewer] - This script by Kocher shows selected statistics, you can scroll up and down through all available days and for those days (or all days) see some summary statistics at the foot of each column.
*[http://sandaysoft.com/forum/viewtopic.php?f=14&t=15983#p122552 SQL dayfile data Viewer] - This script by Kocher shows selected statistics, you can scroll up and down through all available days and for those days (or all days) see some summary statistics at the foot of each column.
*[http://sandaysoft.com/forum/viewtopic.php?f=14&t=16880#p129719 MySQL code help] - This shows a snippet of a PHP script by SFWS for creating a table that for a particular criterion shows the value with all the years as column headers and all the days of a year (1 Jan to 31 Dec) as rows.  The provided script uses standard HTML to show/hide each month.
*[http://sandaysoft.com/forum/viewtopic.php?f=14&t=16880#p129719 MySQL code help] - This shows a snippet of a PHP script by SFWS for creating a table that for a particular criterion shows the value with all the years as column headers and all the days of a year (1 Jan to 31 Dec) as rows.  The provided script uses standard HTML to show/hide each month.
*[http://sandaysoft.com/forum/viewtopic.php?f=14&t=10755#p87081 Top 10 Records Page]- This script by Mark Crossley runs several queries against the daily summary table of a database and picks various extremes displaying the top ten extremes (e.g. ).  The latest source php can be seen using a [http://weather.wilmslowastro.com/top10s.php?view=sce query-string on Mark Crossley's web site] and there have been several updates since the forum thread was created.
*[http://sandaysoft.com/forum/viewtopic.php?f=14&t=10755#p87081 Top 10 Records Page]- This script by Mark Crossley runs several queries against the daily summary table of a database and picks various extremes displaying the top ten extremes (e.g. ).  The latest source php can be seen using a [http://weather.wilmslowastro.com/top10s.php?view=sce query-string on Mark Crossley's web site] and there have been several updates since the forum thread was created.
5,838

edits