IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

I strongly advise all users using my server for their web site to make alternative arrangements.

Outgoing mail is disabled because of the malware on the server. No new forum registrations are currently possible, and mail to the forum administrator will not work.

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Top 10 Records Page

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

Moderators: daj, TNETWeather

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

Re: Top 10 Records Page

Postby Hunter362 » Wed Aug 15, 2018 3:55 am

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Postby mcrossley » Wed Aug 15, 2018 7:37 pm

Do all the queries up to that point work OK?

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

Re: Top 10 Records Page

Postby Hunter362 » Thu Aug 16, 2018 1:33 am

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Postby mcrossley » Thu Aug 16, 2018 6:41 pm

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: 82
Joined: Tue Oct 19, 2010 12:20 am
Weather Station: Ambient Weather WS-2080
Operating System: Windows 7 - Ubuntu 14.4
Location: Fairmount, New York (USA)
Contact:

Re: Top 10 Records Page

Postby Hunter362 » Thu Aug 16, 2018 8:06 pm

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


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 4 guests