Page 2 of 2

Re: Feels like not recording correctly

Posted: Wed 20 May 2020 11:08 am
by dazza1223
ah nice one yh i will try it out and give u some feed back!!! :)

Re: Feels like not recording correctly

Posted: Wed 20 May 2020 12:10 pm
by sfws
dazza1223 wrote: Wed 20 May 2020 11:08 am but how dose it inport like let say last year dose it read it like from the Apr19log.txt?
Yes.

The script that updates the standard log files will update whatever logfile you specify, it does not care whether this month, last month, last year or whatever.

If the log file line has less than 28 fields it adds the extra fields. The 28th field is feels like, and a figure will be inserted for that even if there were fewer fields before.

Re: Feels like not recording correctly

Posted: Wed 20 May 2020 12:47 pm
by dazza1223
yh i notice it was reading the dayfile out off the database but ive run it and it giveing me a error

[20-May-2020 12:44:26 UTC] PHP Parse error: syntax error, unexpected 'if' (T_IF) in /home/daviswor/public_html/Update_DailyFeelsLike(special).php on line 81


https://www.davisworthing.co.uk/Update_ ... ecial).php

Re: Feels like not recording correctly

Posted: Wed 20 May 2020 2:23 pm
by sfws
dazza1223 wrote: Wed 20 May 2020 12:47 pm ive run it and it giving me a error

[20-May-2020 12:44:26 UTC] PHP Parse error: syntax error, unexpected 'if' (T_IF) in /home/daviswor/public_html/Update_DailyFeelsLike(special).php on line 81
Well spotted, somehow I deleted the semicolon from the end of the previous line, when I added the comment there to help people.
I did not have comment in the script I tested, but I did have semi-colon.


Can I safely assume that you did the log files update first without any problems, and then used ExportMySQL monthly to update the monthly table, since you don't mention that?
The daily update will not change any rows if it can not find feels like values to read from the monthly table.

Re: Feels like not recording correctly

Posted: Wed 20 May 2020 8:05 pm
by dazza1223
sorry i hade to sort kids out now it play time

yh that Update_Monthly_FeelsLike(special).php is now giveing me this
Failed to connect to the database server - php_network_getaddresses: getaddrinfo failed: Name or service not known


#0 {main}
thrown in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php on line 9
[20-May-2020 20:01:24 UTC] PHP Fatal error: Uncaught Error: Call to undefined function output() in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php:9
Stack trace:
#0 {main}
thrown in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php on line 9
[20-May-2020 20:02:33 UTC] PHP Warning: A non-numeric value encountered in /home/daviswor/public_html/NOAA.php on line 260
[20-May-2020 20:02:36 UTC] PHP Warning: A non-numeric value encountered in /home/daviswor/public_html/NOAA.php on line 260
[20-May-2020 20:03:46 UTC] PHP Warning: Use of undefined constant liveboxserver - assumed 'liveboxserver' (this will throw an Error in a future version of PHP) in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php on line 5
[20-May-2020 20:03:46 UTC] PHP Warning: Use of undefined constant uk - assumed 'uk' (this will throw an Error in a future version of PHP) in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php on line 5
[20-May-2020 20:03:46 UTC] PHP Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php on line 5
[20-May-2020 20:03:46 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/daviswor/public_html/Update_Monthly_FeelsLike(special).php on line 5

Re: Feels like not recording correctly

Posted: Wed 24 Feb 2021 8:41 pm
by dazza1223
hi nice script but im stuck on when it creat the new log file and i open it dumping Humidex it just has a long number



01/12/19 00:00 4.9 85 2.6 1 3 338 0 0 1019.47 498.2 13.9 62 1 4.9 4.9 1.6 0 0 0 3 0 0 148 0 0 4.9 2.2584119796967'






$text = $lineDate . ' ' . $lineTime . '; Canadian Humidity Index ';
$huCalc = calcMXHumidex($temp, $tempunitnodeg, $decimalSymbol, $humidity);
if(is_null($field)) updateField($text, 'Field currently null', $huCalc, ': Temperature= ' . $temp .'; units=' . $tempunitnodeg . '; decimal symbol=' . $decimalSymbol . '; humidity=' . $humidity);
elseif($field == ' ') updateField($text, 'Field currently space', $huCalc, ': Temperature= ' . $temp .'; units=' . $tempunitnodeg . '; decimal symbol=' . $decimalSymbol. '; humidity=' . $humidity);
elseif(abs($field - $huCalc) >= 0.1) updateField($text, ' was ' . $field . ' ....Difference ' . abs($field - $huCalc) . ' is 0.1 or more, so ', $huCalc, ': Temperature= ' . $temp
.'; units=' . $tempunitnodeg . '; decimal symbol=' . $decimalSymbol . '; humidity=' . $humidity);
else fwrite($updateHandle, $text . ' not updated from ' . $field . "\n");