Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Top 10 Records Page

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Hunter362
Posts: 93
Joined: Tue 19 Oct 2010 12:20 am
Weather Station: Ambient Weather WS-2080
Operating System: Ubuntu 14.4
Location: Fairmount, New York (USA)
Contact:

Re: Top 10 Records Page

Post by Hunter362 »

I know this is an old thread, but am moving my server to Ubuntu 16.04, with php 7
am having a heck of a time reading anything from my Mysql Database.

ERROR - Bad Select Statement (1) -
SELECT LogDate, ROUND(HeatDegDays, 1), Logdate >= DATE_SUB('2018-08-13', INTERVAL 32 DAY) FROM DayfileMX WHERE HeatDegDays IS NOT NULL ORDER BY HeatDegDays DESC, LogDate ASC LIMIT 10
Unknown column 'HeatDegDays' in 'field list'

The above query works fine and displays what it should in phpmyadmin, but on mark's most recent Top10 script thats the error I get.
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Do all the queries up to that point work OK?
Hunter362
Posts: 93
Joined: Tue 19 Oct 2010 12:20 am
Weather Station: Ambient Weather WS-2080
Operating System: Ubuntu 14.4
Location: Fairmount, New York (USA)
Contact:

Re: Top 10 Records Page

Post by Hunter362 »

Hi Mark,
It has to be the different mysql version's, not just your script.
My site is currently running Ubuntu 14.04 - mysql v 5.5.61
New server is runing Ubuntu 16.04 - mysql v 5.7.23

It seems to be the change in mysql query's and such, changes from "mysql" to "mysqli" and other's, there's a whole bunch
of different things in your most recent Top10 page, then the one I'm currently using, 0.17
I only have a couple scripts that use the mysql datbase, your Top10 and a previous year's one that I cobbled together,
if you saw it you'd laugh! php or mysql guru I'm not, but I can usually make it work eventually, just hoping that you had a somewhat
easier fix.
P.S. I am able to log into the server fine using the script, I had to add a $table_name parm as you have, it has to be the select and display and such.

Import Cumulus v 3.0
Running from web server
Script start: 15/08/18 - 21:50:22
Importing file: dayfile.txt, To table: Dayfile ...
Connected to database OK.
Set MySQL TZ OK.
Processing dayfile...
Target table already exists.
ERROR - Failed to prepare the insert statement: Dayfile, error: Unknown column 'HighHeatInd' in 'field list'
INSERT IGNORE INTO Dayfile (LogDate,HighWindGust,HWindGBear,THWindG,MinTemp,TMinTemp,MaxTemp,TMaxTemp,MinPress,TMinPress,MaxPress,TMaxPress,MaxRainRate,TMaxRR,TotRainFall,AvgTemp,TotWindRun,HighAvgWSpeed,THAvgWSpeed,LowHum,TLowHum,HighHum,THighHum,TotalEvap,HoursSun,HighHeatInd,THighHeatInd,HighAppTemp,THighAppTemp,LowAppTemp,TLowAppTemp,HighHourRain,THighHourRain,LowWindChill,TLowWindChill,HighDewPoint,THighDewPoint,LowDewPoint,TLowDewPoint,DomWindDir,HeatDegDays,CoolDegDays,HighSolarRad,THighSolarRad,HighUV,THighUV,HWindGBearSym,DomWindDirSym) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
End.
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Ah, so it's the importcumulus script that had the error, not the top 10s. I recommend you use the last 2.x version, rather than 3.x as that seems to have issues for some people that I haven't got to the bottom of yet. But it looks like your tables were defined some time ago and new columns have been added since.
Just add the new columns using phpmyadmin
Hunter362
Posts: 93
Joined: Tue 19 Oct 2010 12:20 am
Weather Station: Ambient Weather WS-2080
Operating System: Ubuntu 14.4
Location: Fairmount, New York (USA)
Contact:

Re: Top 10 Records Page

Post by Hunter362 »

Sorry, I should have said the ImportCumulus file does the same thing, I'll try an earlier version and see if it works, I still get the error with the Top10
but I believe it's the newer (for me) mysql 5.7
** Edit: for the record ImportCumulus V.27 worked as it should, thanks for the advice. **

ERROR - Bad Select Statement (1) -
SELECT LogDate, ROUND(HeatDegDays, 1), Logdate >= DATE_SUB('2018-08-15', INTERVAL 32 DAY) FROM Dayfile1 WHERE HeatDegDays IS NOT NULL ORDER BY HeatDegDays DESC, LogDate ASC LIMIT 10
Unknown column 'HeatDegDays' in 'field list'

Above is the error from v 0.17
This is from v 2.1 using a different named database, same (dayfile data) just the one written directly by MX

ERROR - Bad Select Statement (4) -Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'weather.DayfileMX.LogDate' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Post Reply