Parsing log to database
Moderator: Forum Moderators
-
andershede
- Posts: 9
- Joined: Fri May 26, 2006 10:49 am
Parsing log to database
I really wish that I could parse the information in the log.txt to my database, så that I was possible for some longterm statistic-calculations.
Well It is possible but I am not able to make it, has any of the hardcore programmers in the TS-community a solution so that f.instance the final table after each racing day can be transformed to a mysql or similar database?
Well It is possible but I am not able to make it, has any of the hardcore programmers in the TS-community a solution so that f.instance the final table after each racing day can be transformed to a mysql or similar database?
-
andershede
- Posts: 9
- Joined: Fri May 26, 2006 10:49 am
I have some trouble now.
I want to run the server locally, and want to use my webhotel as the serverdatabase.
Therefore I need to open a local file C:\games\turbosliders18\racestats.log in autostats.php
Autostats.php is placed on the web http://..//..//autostats.php, but I seems like it does not want to open the local c:\... file. How to procede?
The http://..//autostats.php is trying to open (but apparantly not succeding)
$file = "C:/Games/turboslider18/racestats.log";
Is there anyway I can succes in this procedure, as I dont want to have local php installations, when I have a giant webhotel.
I want to run the server locally, and want to use my webhotel as the serverdatabase.
Therefore I need to open a local file C:\games\turbosliders18\racestats.log in autostats.php
Autostats.php is placed on the web http://..//..//autostats.php, but I seems like it does not want to open the local c:\... file. How to procede?
The http://..//autostats.php is trying to open (but apparantly not succeding)
$file = "C:/Games/turboslider18/racestats.log";
Is there anyway I can succes in this procedure, as I dont want to have local php installations, when I have a giant webhotel.
-
andershede
- Posts: 9
- Joined: Fri May 26, 2006 10:49 am
Both PHP and Mysql is installet on the web. (and all the sql-tabels created)
it is only when it comes to reading the local file, it seems to fail, as nothing happens.
When I install php on my local computer, it wont connect to the web-database, so thats not functionable either.
(and I think it would be much nicer, if all you had to have in your raceend.cmd was "http:/../.../autostats.php" but as I mentioned it seems like online autostats.phpfile wont read the local racestats.log file.)
it is only when it comes to reading the local file, it seems to fail, as nothing happens.
When I install php on my local computer, it wont connect to the web-database, so thats not functionable either.
(and I think it would be much nicer, if all you had to have in your raceend.cmd was "http:/../.../autostats.php" but as I mentioned it seems like online autostats.phpfile wont read the local racestats.log file.)
-
andershede
- Posts: 9
- Joined: Fri May 26, 2006 10:49 am
.
Got a little further, I have to use the "file":
$file = file("c:\\games\\turboslider18\\racestats.log");
But then I get an Unable to access c:\games\turboslider18\racestats.log but at least now it tries :l
$file = file("c:\\games\\turboslider18\\racestats.log");
But then I get an Unable to access c:\games\turboslider18\racestats.log but at least now it tries :l
-
andershede
- Posts: 9
- Joined: Fri May 26, 2006 10:49 am
.
the HTTP is far away - it is something that I pay an amount for each month.
The TS is on my own Harddisk. I am not particulary interested in running a webserver on my computer each time we race TS - it seems so much more logical to use the webspace I pay for, as it has both php and mysql support.
I have received the answer from experts, that it does not seem possible to make an online script look for files on a local drive. so I must find another solution.
The TS is on my own Harddisk. I am not particulary interested in running a webserver on my computer each time we race TS - it seems so much more logical to use the webspace I pay for, as it has both php and mysql support.
I have received the answer from experts, that it does not seem possible to make an online script look for files on a local drive. so I must find another solution.
-
andershede
- Posts: 9
- Joined: Fri May 26, 2006 10:49 am
finally
I finally got it to work.
A remote webserver cant read a local file. That was my problem; Therefore I had to do the following. Raceend.cmd is now running a script.ftp file (a batch file for the "ftp"-dos syntax) in order to move the local file up.
In this I use the Dos-command "ftp" to connect to my remote webserver and I use "send" to upload racestats.log
After this the ftp-script ends and I call autostats.php to put the information into the database.
It is quite complicated, but I gives some pleasure in succeding.
Finally Wget.exe (a little program)takes care of running the http://..//autostats.php
So now it is possible for local games to have stats on remote servers.
A remote webserver cant read a local file. That was my problem; Therefore I had to do the following. Raceend.cmd is now running a script.ftp file (a batch file for the "ftp"-dos syntax) in order to move the local file up.
In this I use the Dos-command "ftp" to connect to my remote webserver and I use "send" to upload racestats.log
After this the ftp-script ends and I call autostats.php to put the information into the database.
It is quite complicated, but I gives some pleasure in succeding.
Finally Wget.exe (a little program)takes care of running the http://..//autostats.php
So now it is possible for local games to have stats on remote servers.

