Page 13 of 15

Re: Top 10 Records Page

Posted: Fri 11 May 2018 2:18 pm
by mcrossley
Hmm, did you edit a file with MS Word!

Re: Top 10 Records Page

Posted: Fri 11 May 2018 2:48 pm
by Mrc
mcrossley wrote:Hmm, did you edit a file with MS Word!
Yes i did, should i use notepad instead?

Re: Top 10 Records Page

Posted: Fri 11 May 2018 2:53 pm
by mcrossley
Preferably something like Notepad++ that understands text encoding properly. You may be able to use Notepad, but *never* use Word to edit a text file.

Re: Top 10 Records Page

Posted: Fri 11 May 2018 4:29 pm
by Mrc
Well, now it created dayfile table but ran into a new problem:

Prepared SQL statement OK.
Inserting data...
Error: Failed to bind the SQL parameters!

How can i fix that error?

Re: Top 10 Records Page

Posted: Fri 11 May 2018 4:32 pm
by mcrossley
This was raised a couple of days ago, I haven't had time to look at yet. Download version 2.8 of the script and try that for now.

Re: Top 10 Records Page

Posted: Fri 11 May 2018 4:52 pm
by Mrc
2.8 version didn't work either:
Error: You must supply a 'table' parameter/value

Re: Top 10 Records Page

Posted: Fri 11 May 2018 5:12 pm
by mcrossley
What did you enter for the table parameter?

Re: Top 10 Records Page

Posted: Fri 11 May 2018 5:18 pm
by Mrc
I only edited password, username etc.. I did everything same way as with version 3-1.

Re: Top 10 Records Page

Posted: Sat 12 May 2018 6:47 am
by Mrc
And now i get this error with 2-8 version:
Inserting data...
Error: Failed to insert data:
INSERT IGNORE INTO (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('--30.05.15;9','5;90;17:45;14','2;21:15;18','5;17:30;996','1;21:15;1002','6;12:45;0','0;00:00;0','0;16','8;259','2;4','8;20:15;40;13:15;57;21:15;0','00;0','0;18','5;17:30;15','8;14:15;10','4;20:45;0','0;00:00;13','2;21:15;6','7;16:15;3','0;13:15;90;1','5;0','0;0;00:00;0','0;00:00 ',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'N',NULL)

Re: Top 10 Records Page

Posted: Sat 12 May 2018 7:51 am
by sfws
An SQL insert will only work if each of the column names within the first brackets is associated with within the second set of brackets either null or one value in quotes. The separator for SQL lists is a comma.

The SQL you quote does not conform to that, in too many ways for me to count!

Re: Top 10 Records Page

Posted: Sat 12 May 2018 2:27 pm
by jlmr731
What ever this is I dont think its the top 10 script, That script (top10) only reads the data, it does not write to the database. Insert is a write command.

Mrc wrote:And now i get this error with 2-8 version:
Inserting data...
Error: Failed to insert data:
INSERT IGNORE INTO (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('--30.05.15;9','5;90;17:45;14','2;21:15;18','5;17:30;996','1;21:15;1002','6;12:45;0','0;00:00;0','0;16','8;259','2;4','8;20:15;40;13:15;57;21:15;0','00;0','0;18','5;17:30;15','8;14:15;10','4;20:45;0','0;00:00;13','2;21:15;6','7;16:15;3','0;13:15;90;1','5;0','0;0;00:00;0','0;00:00 ',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'N',NULL)

Re: Top 10 Records Page

Posted: Sat 12 May 2018 2:27 pm
by mcrossley
Mrc wrote:I only edited password, username etc.. I did everything same way as with version 3-1.
Yes, but when you call the script you have to supply a bunch of values so the script knows whether it a monthly file or daily or realtime. What your table name is etc. The format for calling the script is embedded in the comments within the script. It looks like your log file delimiter is a semi-colon. The default in the script is a comma, so you will need to changed that too. As pointed out above the lack of parameters and incorrect delimiter means the SQL being created is gibberish!

Re: Top 10 Records Page

Posted: Sat 12 May 2018 6:03 pm
by Mrc
Sorry to bother again but i think the import cumulus script works:
Processing dayfile: dayfile.txt
Inserting data...
Inserted 1078 rows
done.

But Top10.php still has error:
ERROR - Bad Select Statement (1) - No database selected

I tried to comment out solar hours which i don't have but it didn't help.

Re: Top 10 Records Page

Posted: Sat 12 May 2018 6:41 pm
by sfws
jlmr731 wrote:That script (top10) only reads the data, it does not write to the database. Insert is a write command
I understand that, but I was responding to the SQL you quoted.
Mrc wrote:i think the import cumulus script works:
Processing dayfile: dayfile.txt
Inserting data...
Inserted 1078 rows
done.
Good, progress. So you have a database table with plenty of rows.
mcrossley wrote:when you call the script you have to supply a bunch of values so the script knows
Mrc wrote:But Top10.php still has error:
ERROR - Bad Select Statement (1) - No database selected
As the error suggests, the top 10 script has some parameters too. You need to tell the top 10 script where to read the data from.

I have my own scripts for both the database loading and for top ten output, so I can't say exactly what you need for the script you are using, but I am sure Mark will have included comments in his script to explain what is needed. Quite possibly the database name, table name use the same variables in both scripts, so if you found names for loading, you can find them for reading.

Re: Top 10 Records Page

Posted: Sat 12 May 2018 6:57 pm
by Mrc
Progress again, now there's no error but instead just white blank page :shock: