Page 1 of 1

Data not written to database

Posted: Sat 16 May 2020 9:48 am
by ole.vik
Hi

Just installed the template and it seemingly Works as it should. But, when i check the db, nothing is written there.
So i guess a lot of statistics are getting lost atm. Any chance of getting a pointer to how i can go by to fix this?
I have double and triple checked the db_name, db_user and db_host parameters, so that should be correct.
The database and tables are generated. Perhaps there is some testscript i could try against the db?

Site: https://www.tyrirabben.net

Re: Data not written to database

Posted: Sun 24 May 2020 10:26 am
by ole.vik
So..no one? I can provide more info if wanted.

As mentioned, my database is working, i just can't find out where and how data is supposed to be written to it.
Do i have to set up a Cron job? Do i have to specify somewhere that the realtime data, should be written to the database?

The only Reference i have found on using the defined database in the setup script, is in the Cron scripts. But then only
as a Source for chartgeneration.

**
if ($chartsource =="mbcharts"){
//connect to mysqli db for homeweatherstation save to csv files october 2017
$conn = mysqli_connect($db_host,$db_user,$db_pass,$db_name);
$result = mysqli_query($conn,'SELECT * FROM `weatherstation`');
if (!$result) die('Couldn\'t fetch records');
**

First of all, where do i define the variable "mbcharts" ? If i had historical data in my database, i'd like to use that Source instead of WU
Second, to get actual data into the referenced MySQL database - i cant find any scripts doing it. I've sniffed tcp Connections from the
webserver, and it never tries to even contact the sql server. Not even when i specify the host/user/pass in the initial setup.

Any help appreciated. If its not possible, please let me know. I hate losing historical data.