Closed unlstorm closed 6 years ago
Unless the clock is wrong or someone is trying to do a chart for a future date then you only need to compare today with end_date.
So sqlThree should only be included if end_date >= today
Does that seem logical?
I am replacing pChart with a client side JavaScript charting utility. Before I moved the code off the hosted server I was getting tasks killed because I was using too much of the CPU and as a consequence, no more charts. New code posting soon-ish.
It it because of the $sqlThree query. I think we can avoid that query all together if the current day does not fall into the range of the currently plotted data. Is it easy to see if "today" falls between the range of $start_date and $end_date and only if it does, perform the sqlThree query?