Page 1 of 1

ExtraLog*.txt to mysql and then to webpage

Posted: Thu 06 Apr 2017 1:45 pm
by Snicker
Hi,

A friend made me a php script that takes out the data from the ExtraLog*.txt file and inserts it into mysql server, and then make a graph out of the SQL data with PHP. Anyone good at PHP that can help me put this up again on another site?

It is a cronjob.php that runs every 10 min automaticly,
and the index.php that shows the graph.

Re: ExtraLog*.txt to mysql and then to webpage

Posted: Fri 07 Apr 2017 3:23 pm
by Snicker
Here is the link to the php script reading the log file and putting the data into the SQL.

https://pastebin.com/Smy4BS1m

Getting this error when I try to run the php.

Notice: Undefined variable: wdato in D:\wamp64\www\temp\cronjob.php on line 81

Re: ExtraLog*.txt to mysql and then to webpage

Posted: Fri 07 Apr 2017 4:52 pm
by Snicker
Found out,

Had to create a new structure like this on the SQL:

https://www.dropbox.com/s/s1zb17z2b1dwp ... e.PNG?dl=0

And then insert a new fictive one for the script to check. Then it worked.

Re: ExtraLog*.txt to mysql and then to webpage

Posted: Fri 11 Aug 2017 3:40 pm
by hruska07
Hello, i have problem to import Cummulusfile to MySQL database. It caused an error about connection to the database server....Any idea? I would be glad.