Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.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
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.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
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
Display data from SQL in a table on your website
- GraemeT
- Posts: 312
- Joined: Wed 21 Oct 2009 11:19 am
- Weather Station: La Crosse WS-2355 & WS-2306
- Operating System: Windoze 7, 10, 11
- Location: Bayswater, Australia
- Contact:
Re: Display data from SQL in a table on your website
Thanks David, I'll try that. Just a bit frustrating to get everything compliant and then find
something that works ok but doesn't comply because of the vagaries of html!
I think my main trouble is I don't understand why <br /> isn't allowed in this instance.
W3C doesn't make it clear to me at all...
Here are links to my original and current dayfile:
Original without fields 17&18:
http://weather.gktnet.com/data/dayfile%20-%20copy.txt
New file with fields 17&18 added and filled with dummy values:
http://weather.gktnet.com/data/dayfile.txt
It doesn't really matter from my perspective now, as I've filled in the values for all the dates prior to 25-Jan-10,
but others may have the same problem and they might have a longer dayfile.txt
Bye for now.
something that works ok but doesn't comply because of the vagaries of html!
I think my main trouble is I don't understand why <br /> isn't allowed in this instance.
W3C doesn't make it clear to me at all...
Here are links to my original and current dayfile:
Original without fields 17&18:
http://weather.gktnet.com/data/dayfile%20-%20copy.txt
New file with fields 17&18 added and filled with dummy values:
http://weather.gktnet.com/data/dayfile.txt
It doesn't really matter from my perspective now, as I've filled in the values for all the dates prior to 25-Jan-10,
but others may have the same problem and they might have a longer dayfile.txt
Bye for now.
Cheers,
Graeme.
Graeme.
- daj
- Posts: 2041
- Joined: Tue 29 Jul 2008 8:00 pm
- Weather Station: WH1081
- Operating System: Pi & MX
- Location: SW Scotland
- Contact:
Re: Display data from SQL in a table on your website
Originally I thought it was because I was using formatting tags in the <head> section, however I moved the script into the <body> section and still had the same issue. W3C certainly does not make it clear why it is not allowed. I can replace the <br/> with <span> and then use CSS to display in blocks, but again it gets rejected. To be honest, it is better not to have script in the HTML -- far better to call it from a file anyway. I only included it in the HTML to try and keep things as simple as I could as part of the packageGraemeT wrote:Thanks David, I'll try that. Just a bit frustrating to get everything compliant and then find
something that works ok but doesn't comply because of the vagaries of html!
I think my main trouble is I don't understand why <br /> isn't allowed in this instance.
W3C doesn't make it clear to me at all...
It's odd, as I have seen several installations now and none have had this problemIt doesn't really matter from my perspective now, as I've filled in the values for all the dates prior to 25-Jan-10,
but others may have the same problem and they might have a longer dayfile.txt
- GraemeT
- Posts: 312
- Joined: Wed 21 Oct 2009 11:19 am
- Weather Station: La Crosse WS-2355 & WS-2306
- Operating System: Windoze 7, 10, 11
- Location: Bayswater, Australia
- Contact:
Re: Display data from SQL in a table on your website
A revelation!
Out of interest I tried enclosing the offending line as below:
Job's right! The javascript parser ignores the CDATA term as it's commented out and the XML parser ignores the line enclosed by the CDATA term - no more errors from the <br/> tags.
I don't understand why it has to be commented out with // but if not, the script doesn't display the table.
More info here:
http://www.w3schools.com/XML/xml_cdata.asp
and here:
http://msdn.microsoft.com/en-us/library/ms256076.aspx
Something else which came to light about 5 minutes ago:
causes an unfinished tag error as the table wants row and cell tags as below:
which fixes the error.
That's it for me. Going off to do something else for a while...
Out of interest I tried enclosing the offending line as below:
Code: Select all
// <![CDATA[
colNames:['Date','Highest<br/>Gust<br/>(mph)','Wind<br/>Bearing','Time of<br/>Gust','Min. Temp<br/>(°C)','Time of<br/>Min.','Max. Temp<br/>(°C)','Time of<br/>Max.','Avg. Temp<br/>(°C)','Lowest<br/>pressure<br/>(mb)','Time of<br/>Min.','Highest<br/>pressure<br/>(mb)','Time of<br/>high','Highest<br/>Rain rate<br/>(mm/hr)','Time of<br/>High Rate','Total Rain<br/>fall (mm)','Tot.Wind<br/>run'],
// ]]>
I don't understand why it has to be commented out with // but if not, the script doesn't display the table.
More info here:
http://www.w3schools.com/XML/xml_cdata.asp
and here:
http://msdn.microsoft.com/en-us/library/ms256076.aspx
Something else which came to light about 5 minutes ago:
Code: Select all
<table id="list"></table>
<div id="pager"></div>
</div>Code: Select all
<table id="list"><tr><td></td></tr></table>
<div id="pager"></div>
</div>That's it for me. Going off to do something else for a while...
Cheers,
Graeme.
Graeme.
-
n9mfk
- Posts: 845
- Joined: Sun 10 May 2009 8:52 pm
- Weather Station: davis vp2 Serial datalogger
- Operating System: Windows 7 64-bit
- Location: Springfield, IL
Re: Display data from SQL in a table on your website
Hi David,
is there away to do this with out js
Beau
is there away to do this with out js
Beau
- daj
- Posts: 2041
- Joined: Tue 29 Jul 2008 8:00 pm
- Weather Station: WH1081
- Operating System: Pi & MX
- Location: SW Scotland
- Contact:
Re: Display data from SQL in a table on your website
Is there life without JS?! LOL
I could probably do it in PHP
Curious -- why not JS?
I could probably do it in PHP
Curious -- why not JS?
-
n9mfk
- Posts: 845
- Joined: Sun 10 May 2009 8:52 pm
- Weather Station: davis vp2 Serial datalogger
- Operating System: Windows 7 64-bit
- Location: Springfield, IL
Re: Display data from SQL in a table on your website
Hi David,
I have a friend that uses my site with his screen reader
it does like js so that page can not be read
Beau
I have a friend that uses my site with his screen reader
it does like js so that page can not be read
Beau
-
n9mfk
- Posts: 845
- Joined: Sun 10 May 2009 8:52 pm
- Weather Station: davis vp2 Serial datalogger
- Operating System: Windows 7 64-bit
- Location: Springfield, IL
Re: Display data from SQL in a table on your website
Hi David
I us inHG on my davis station for my pressure what wood i need to change to show 3 digits after the point im not sure what file to change?
Thanks Beau
I us inHG on my davis station for my pressure what wood i need to change to show 3 digits after the point im not sure what file to change?
Thanks Beau
- daj
- Posts: 2041
- Joined: Tue 29 Jul 2008 8:00 pm
- Weather Station: WH1081
- Operating System: Pi & MX
- Location: SW Scotland
- Contact:
Re: Display data from SQL in a table on your website
It's actually the import you will need to adjust, not the table that displays it.n9mfk wrote:Hi David
I us inHG on my davis station for my pressure what wood i need to change to show 3 digits after the point im not sure what file to change?
Thanks Beau
Edit the ImportCumulusFile.php file and look for the line starting...
(should be line 100)
Code: Select all
$CreateQuery="CREATE TABLE " . $table_name . " (LogDate date NOT NULL ,HighWindGust decimal(4,1)........For consistency, also change line 107...
Change ...Pressure decimal(6,2) to (7,3)
Delete your SQL table and re-import so that it creates the table again
- daj
- Posts: 2041
- Joined: Tue 29 Jul 2008 8:00 pm
- Weather Station: WH1081
- Operating System: Pi & MX
- Location: SW Scotland
- Contact:
Re: Display data from SQL in a table on your website
Beaun9mfk wrote:is there away to do this with out js
Kevin has done us proud.....
https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=2419
-
Hillbilly
- Posts: 112
- Joined: Tue 26 Jan 2010 8:54 am
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: Vista Home Premium SP2
- Location: Mayenne, Pays De La Loire, France
- Contact:
Re: Display data from SQL in a table on your website
David,
This is now up and running. Thanks very much for producing it. It has worked a treat.
This is now up and running. Thanks very much for producing it. It has worked a treat.
-
gismoat
- Posts: 3
- Joined: Wed 08 Dec 2010 9:37 am
- Weather Station: WH1080
- Operating System: Windows7
- Location: Thalgau
- Contact:
Re: Display data from SQL in a table on your website
Hi all,
i have uploadet all files via FTP to my webspace.
dbconfic.php is setup with my login data.
1.) how can i create a dayfile.txt ?
2.) wen i use the read_dayfile i become an error!
=> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/web10/html/wetter/read_dayfile.php on line 25
Couldn't execute query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2
URL to my weather files is http://arbeiter4ever.com/wetter/
Please help me.
thanks
GismoAT
i have uploadet all files via FTP to my webspace.
dbconfic.php is setup with my login data.
1.) how can i create a dayfile.txt ?
2.) wen i use the read_dayfile i become an error!
=> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/web10/html/wetter/read_dayfile.php on line 25
Couldn't execute query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2
URL to my weather files is http://arbeiter4ever.com/wetter/
Please help me.
thanks
GismoAT
- daj
- Posts: 2041
- Joined: Tue 29 Jul 2008 8:00 pm
- Weather Station: WH1081
- Operating System: Pi & MX
- Location: SW Scotland
- Contact:
Re: Display data from SQL in a table on your website
You need to get your dayfile.txt (created by Cumulus) into your SQL DB. You can do this yourself or use a script to do it
https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=2367
https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=2367
-
gismoat
- Posts: 3
- Joined: Wed 08 Dec 2010 9:37 am
- Weather Station: WH1080
- Operating System: Windows7
- Location: Thalgau
- Contact:
Re: Display data from SQL in a table on your website
Hi,
the script is working good. But i have a question.
How can i change the table size?
I will include the Historic page to my homepage but the aktual table size is to big.
thanks
GismoAT
the script is working good. But i have a question.
How can i change the table size?
I will include the Historic page to my homepage but the aktual table size is to big.
thanks
GismoAT