Page 2 of 3

Re: SQL dayfile data Viewer

Posted: Tue 19 Dec 2017 10:22 pm
by PaulMy
Hi Kocher,
I changed my webserver at GoDaddy to cPanel a couple weeks ago and that included changing my MySQL database. Everything seemed to have worked eventually, except that http://www.komokaweather.com/mysql/dayf ... le-sql.php only goes back to Dec 10. The previous database Dayfile table has data up to Dec 10. The new database Dayfile table is populated to current (Dec 18) so it appears the script is looking in the old database Dayfile table. I've looked in the various files that make up dayfile-sql but have not found where I might need to edit. Any suggestion?

Thanks,
Paul

Re: SQL dayfile data Viewer

Posted: Wed 20 Dec 2017 7:48 am
by sfws
Paul
In server_processing.php, presumably you have changed the database reference in this code found near the end of that file?

Code: Select all

// SQL server connection information
$sql_details = array(
	'user' => $dbuser,
	'pass' => $dbpassword,
	'db'   => theDatabase,
	'host' => $dbhost
);
I'm busy doing a massive rewrite of my METAR decoder to try to speed it up at the moment, so I have not looked through other scripts making up dayfile-sql but I think this is what you were unable to find. I did notice on your page that a couple of entries in the summary line are not showing figures, I solved that when I implemented the dayfile-sql script on my PC, I think it was something to do with whether units are added or not, but I can't recall exactly. Maybe I will have a look later.

I note that the download in the first post of this thread is no longer available, but fortuently I use the script so have it on my PC.
This is my 350th post, I hope that means I have made a small but significant contribution to the community on this forum!

Re: SQL dayfile data Viewer

Posted: Wed 20 Dec 2017 2:17 pm
by PaulMy
Paul
In server_processing.php, presumably you have changed the database reference in this code found near the end of that file?
Thanks sfws, I had not gone in that folder or file. After editing now the table shows to current http://www.komokaweather.com/mysql/dayf ... le-sql.php.

Enjoy,
Paul

Re: SQL dayfile data Viewer

Posted: Wed 20 Dec 2017 7:36 pm
by sfws
Paul
I have now checked, and find I amended "dayfile-sql.???" file where the original had

Code: Select all

 "footerCallback": function ( row, data, start, end, display ) {
            var api = this.api(), data; 
            // Remove the formatting to get integer data for summation
            var intVal = function ( i ) {
                return typeof i === 'string' ?
                    i.replace(/[\mm,\Km,\hPa,]/g, '')*1 :
                    typeof i === 'number' ?
                        i : 0;
            };
My amendment was to add to the list of units in line 255 so it also included the units for the columns where the max/min/average/total was not appearing. From a very quick inspection, it appears that is all I changed to add the missing figures to my footer, the equivalent of your
Date -19.5 °C 34.0 °C 12.2 °C 263.0 mm Bmin Bmax Wgust 5827 Km
Put as simply as I can that is a pattern replacement instruction within the demiiters, it looks for any one of the expressions separated by a comma in the square brackets and replaces it by an empty string (delimited by the pair of single quotes). I'm very new to pattern specifying and had to look up the significance of the 'g' flag for javascript, apparently it gives the expression a global applicability.
If I am correct, then you are missing the \hPa and \km/H units (or for you latter is Km/h apparently). You may have problems with '/' as it appears that character is used as start and end delimiter outside the square brackets. I believe you also need to escape the '/' i.e. '//'. As I said, I am a novice with these expressions, and just starting to learn the PERL ones used with PHP, and the javascript ones might be different.

It is possible I also amended the code snippet dealing with reading from the database and adding the figures to the table but I can't at a quick glance see any other relevant changes.

Re: SQL dayfile data Viewer

Posted: Sat 23 Dec 2017 7:36 pm
by kocher
Greetings to all.

The download link for this script is already working again:

    http://kocher.es/cajon/DataTables-cumulus-dayfile.rar

You can see the installation instructions at:

          https://cumulus.hosiene.co.uk/viewtopic.p ... 83#p122552


Saludos desde San Sebastian :D

Re: SQL dayfile data Viewer

Posted: Thu 28 Dec 2017 2:04 pm
by vpokroglo
Great script!
Do anyone know some script to show data from monthly files- monthly mysql?

Re: SQL dayfile data Viewer

Posted: Fri 19 Jan 2018 7:55 am
by vpokroglo
What does the bottom line (circled-red color) show?
Image

Re: SQL dayfile data Viewer

Posted: Fri 19 Jan 2018 4:11 pm
by sfws
sfws wrote:where the max/min/average/total was
What you ringed in red is supposed to show summary for column. I have just quoted an extract from my earlier post where I mention for my own version I tried to sort out that output line. I will leave it to the author of the script to add any further comment.

Re: SQL dayfile data Viewer

Posted: Wed 14 Feb 2018 7:35 pm
by kocher
Effectively

The foot of the table, contains the summary of each column after conducting a search;

1): Get the minimum temperature of all filtered dates
2): Get the maximum temperature all of the filtered dates.
3): Get the mean value of the average temperature of all the filtered dates.
4): Obtain the sum of the precipitation of the filtered dates.

And so on: Minimum pressure, Maximum pressure, Maximum windgust and the Total kilometers traveled by the wind:


http://kocher.es/central.php

Saludos desde San Sebastian, Spain

Re: SQL dayfile data Viewer

Posted: Sun 18 Feb 2018 8:20 am
by vpokroglo
kocher wrote:Effectively

The foot of the table, contains the summary of each column after conducting a search;

1): Get the minimum temperature of all filtered dates
2): Get the maximum temperature all of the filtered dates.
3): Get the mean value of the average temperature of all the filtered dates.
4): Obtain the sum of the precipitation of the filtered dates.

And so on: Minimum pressure, Maximum pressure, Maximum windgust and the Total kilometers traveled by the wind:


http://kocher.es/central.php

Saludos desde San Sebastian, Spain

I am not sure if this is correct,

If I set filter to 2017 (year only), I get different values when scrolling down, so data shown in the bottom row is unusable in this way.
If I set year and month, it is OK.

Re: SQL dayfile data Viewer

Posted: Tue 31 Jul 2018 9:55 am
by ConligWX
Does anyone have the full archive handy to download? links provided are dead.

Re: SQL dayfile data Viewer

Posted: Wed 26 Sep 2018 5:19 pm
by kocher
I am sorry

The link is now active again:

http://kocher.es/cajon/DataTables-cumulus-dayfile.rar

Re: SQL dayfile data Viewer

Posted: Sun 06 Jan 2019 8:51 pm
by typiod
Hi any chance of a working link to the file thanks.

Re: SQL dayfile data Viewer

Posted: Sun 06 Jan 2019 11:05 pm
by dazza1223
i cant zip one up for you

Re: SQL dayfile data Viewer

Posted: Sun 06 Jan 2019 11:09 pm
by typiod
Hello dazza that would be great if you could.