New Script that displays a selected daily statistic for every day
Posted: Sun 15 Apr 2018 11:50 am
This topic has been started to give the script in the topic https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=16880 a better title for future people to find it on forum.
I have now created a newer zip than the one in the other thread. This attachment now obsolete, but retained to show how many times it was downloaded and in case anyone finds it useful.
+++++++++++++++
EDIT - Due to some confusion - see my 16 Apr post - I have made it clearer how to change between my schema and Mark's schema in the two critical places - where you display the columns available and where you determine the column name of an associated time-stamp
NEWER ZIP This 18 Apr zip is the one to use now, it also reinstates the use of 'selected' so it is clear which column was selected in the form and restores the caption that gives the full English description of the selected column(s). See the postings bearing dates of 18 April 2018 or earlier.
+++++++++++++++
[/color]
This time round, I have included my own schema in the script, I have also worked out and typed in the schema that Mark uses giving it a different name.
I have indicated where you should make changes to my script to use his schema (generally just remove the '#' that signifies a PHP comment, but sometimes delete part of my script).
My schema has been designed to make selection of weather statistic required for retrievals easy, the order of columns means that related columns are grouped (e.g. all wind or all rain), and the naming standard I use makes it easy to write into the retrieval script the inclusion of the time-stamp as well as the value (that is complex for Mark's schema). Also I define useful arrays and functions in common scripts that I include in specific ones, so converting my script to something to post here was actually rather a lot of work. Please reply here, if you find this a useful script, to reward me for the time that I have invested in making it suitable to share.
For those who don't look at the original thread, PaulMy asked for a query to show highest daily temperature for every day:
I decided to make my query available to others, by wrapping a web page round it.
I repeat the following from earlier topic:
I have now created a newer zip than the one in the other thread. This attachment now obsolete, but retained to show how many times it was downloaded and in case anyone finds it useful.
+++++++++++++++
EDIT - Due to some confusion - see my 16 Apr post - I have made it clearer how to change between my schema and Mark's schema in the two critical places - where you display the columns available and where you determine the column name of an associated time-stamp
NEWER ZIP This 18 Apr zip is the one to use now, it also reinstates the use of 'selected' so it is clear which column was selected in the form and restores the caption that gives the full English description of the selected column(s). See the postings bearing dates of 18 April 2018 or earlier.
+++++++++++++++
[/color]
This time round, I have included my own schema in the script, I have also worked out and typed in the schema that Mark uses giving it a different name.
I have indicated where you should make changes to my script to use his schema (generally just remove the '#' that signifies a PHP comment, but sometimes delete part of my script).
My schema has been designed to make selection of weather statistic required for retrievals easy, the order of columns means that related columns are grouped (e.g. all wind or all rain), and the naming standard I use makes it easy to write into the retrieval script the inclusion of the time-stamp as well as the value (that is complex for Mark's schema). Also I define useful arrays and functions in common scripts that I include in specific ones, so converting my script to something to post here was actually rather a lot of work. Please reply here, if you find this a useful script, to reward me for the time that I have invested in making it suitable to share.
For those who don't look at the original thread, PaulMy asked for a query to show highest daily temperature for every day:
The query I produced in response is the main query in my attached script, it adds the time-stamp:PaulMy wrote:I have been trying to create a new script that would have a table of each day's temp for the 10 years of my data -
Year as column header (11 columns from 2008 to 2018)
Each day's date in the left column (365 lines or 366 in leap year) possibly beak it down in monthly blocks
Each day's high temp filled in the table
Code: Select all
SELECT DATE_FORMAT(LogDate, '%e %b'),MaxTemp, TMaxTemp, DATE_FORMAT(LogDate, '%m%d') AS d1, YEAR(logdate) AS y1 FROM daytable WHERE MONTH(LogDate) = 1 ORDER BY d1 ASC, y1 DESC
I repeat the following from earlier topic:
The main feature of the script is the query to retrieve all daily values (that of course takes slightly longer the more days you have in your database table) ... to output that in a simple table with days as rows and years as columns showing a single criterion in the table cells (and my script adds time-stamps where available as my schema makes that easy).
I am using this web page on my own server as a replacement for all the functionality in the data summary design originated by David Jamieson and developed further by others. For those who come to this thread expecting more information about what can be done with daily summary statistics, you might find the Wiki article http://wiki.sandaysoft.com/a/Daily_Summary is a useful pointer to some of the many scripts available. Reading the other topics linked from the Wiki might even provide useful background to help you understand and appreciate what I offer above better.