Author Topic: inc-SPCreports.php warning  (Read 610 times)

0 Members and 1 Guest are viewing this topic.

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
inc-SPCreports.php warning
« on: December 01, 2017, 12:34:35 PM »
Warning: A non-numeric value encountered in /home/hj2ke8lfpx43/public_html/inc-SPCreports.php on line 665 not sure what this is here is what line 665 looks like

Quote
$tScript += ($stop_timer - $start_timer);                               // get start & stop time
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: inc-SPCreports.php warning
« Reply #1 on: December 01, 2017, 02:26:19 PM »
Warning: A non-numeric value encountered in /home/hj2ke8lfpx43/public_html/inc-SPCreports.php on line 665 not sure what this is here is what line 665 looks like

Quote
$tScript += ($stop_timer - $start_timer);                               // get start & stop time

I think I need to find the update to this any one know where?
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: inc-SPCreports.php warning
« Reply #2 on: December 01, 2017, 04:12:35 PM »
If you have
Code: [Select]
$stop_timer = script_time();                                            // stop script time
$tScript += ($stop_timer - $start_timer);                               // get start & stop time
just change it to
Code: [Select]
$stop_timer = script_time();                                            // stop script time
$tScript = 0;                                                          // set variable
$tScript += ($stop_timer - $start_timer);                               // get start & stop time
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: inc-SPCreports.php warning
« Reply #3 on: December 01, 2017, 04:32:31 PM »
What Ken said +1.

The code is currently:

Code: [Select]
$stop_timer = script_time();                                            // stop script time
$tScript = '';                                                          // set variable
$tScript += ($stop_timer - $start_timer);                               // get start & stop time
$time_cull = sprintf("%01.4f", round($stop_timer - $start_timer, 4));   // calculate difference
$noted .= "<!-- Data process time: $time_cull seconds -->\n";           // display time results

$tscript therefore is a string, which creates the error.  Actually, you don't even need that line if you get rid of the plus in the assignment:

Code: [Select]
$tScript = ($stop_timer - $start_timer);
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: inc-SPCreports.php warning
« Reply #4 on: December 01, 2017, 04:48:47 PM »
If you have
Code: [Select]
$stop_timer = script_time();                                            // stop script time
$tScript += ($stop_timer - $start_timer);                               // get start & stop time
just change it to
Code: [Select]
$stop_timer = script_time();                                            // stop script time
$tScript = 0;                                                          // set variable
$tScript += ($stop_timer - $start_timer);                               // get start & stop time

Thanks it worked! :)
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

 

anything