Page 6 of 9

Re: a PHP import script for DayFile and Monthly log files

Posted: Thu 11 Mar 2010 2:24 pm
by daj
Can you try this please....

Change the split function to explode, so in this line.....

Code: Select all

$datearr = split($date_delimiter,$buf_arr['0']);
it should now be

Code: Select all

$datearr = explode($date_delimiter,$buf_arr['0']);

Re: a PHP import script for DayFile and Monthly log files

Posted: Thu 11 Mar 2010 2:39 pm
by Rampe
Excellent, that did the trick! Thanks! :clap:

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 20 Mar 2010 3:09 pm
by penalank
Hello,

I get data into my database, but of some resons not all from the dayfiles and monthly files.
For the monthly files I store data each 10 minute. When i make import into the database i get only firs 7 days into my MySQL.

/Per

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 20 Mar 2010 3:57 pm
by daj
penalank wrote:For the monthly files I store data each 10 minute. When i make import into the database i get only firs 7 days into my MySQL.
There may be a corruption in your log file -- find the last entry in the SQL DB then look at the same location in the text file to see if anything looks odd. Upload the file here and we can have a look

Also, generally on SQL -- you have enough disk space? there are no limits on the number of rows you can insert?

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 20 Mar 2010 4:26 pm
by penalank
Hello,

No limits, have other tables with over 3500000 row in the Database.

I make an test to first import feb10log and get around 950 row in the table, drop the table and import mar10log and
get 920 row after that i import feb10log again without drop the tables, now i get around 2000 row in the tables.
The import not stops on exacly same row every time (around 950 rows).

/Per

Re: a PHP import script for DayFile and Monthly log files

Posted: Sun 21 Mar 2010 5:14 pm
by penalank
Found the problems, was an PHP limits.

max_execution_time = 30 ; Maximum execution time of each script, in seconds

Working perfect after change the time.

/Per

Re: a PHP import script for DayFile and Monthly log files

Posted: Sun 21 Mar 2010 5:23 pm
by daj
penalank wrote:Found the problems, was an PHP limits.
;)

Good news

Re: a PHP import script for DayFile and Monthly log files

Posted: Sun 04 Jul 2010 11:21 am
by kalli51g
hi David , thanks for this PHP script ImportCumulusFile it works ,and the Data-Table.zip for the historic it works too ,thanks alot :clap:

http://ka-ra.org/historic.php

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 6:35 am
by Arnie
Hi David
Attempted to upload the monthly log file as follows
[url]htp://www.wentworthvilleweather.com/ImportCum ... n10log.txt[/url]
I get a Firefox msg "Firefox doesn't know how to open this address, because the protocol (htp) isn't associated with any program"

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 6:58 am
by nitrx
Arnie wrote:Hi David
Attempted to upload the monthly log file as follows
[url]htp://www.wentworthvilleweather.com/ImportCum ... n10log.txt[/url]
I get a Firefox msg "Firefox doesn't know how to open this address, because the protocol (htp) isn't associated with any program"
I think you better use http://www.wentworth etc htp isn't a Hypertext Transfer Protocol

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 7:10 am
by Arnie
I think you better use http://www.wentworth etc htp isn't a Hypertext Transfer Protocol
:bash:

Thanks Ron

Now I am getting "failed to open file" msg

Any clues??

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 7:58 am
by nitrx

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 8:34 am
by Arnie
Thanks Ron
Please bear with me :bash:

I have now uploaded the data/monthlylog files eg Jan10log.txt etc

I now get a msg "failed to connect to database server"

In the "ImportCumulusFile.php" I am using "127.0.0.1" for the server address should this be "localhost" or "ftp.wentworthvilleweather.com"

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 8:44 am
by nitrx
Well I use localhost most webhosters use this but you should follow the name of your hostingprovider I'm absolute sure it isnt ftp good luck

Re: a PHP import script for DayFile and Monthly log files

Posted: Sat 24 Jul 2010 9:12 am
by Arnie
Ive now changed back to "localhost" but still get the failing to connect to server msg as above

Ron pls check my inputs on the ImportCumulusFile.php

$key = "xxxxxxx"
$dbhost = "localhost"
$dbuser = "xxxx@wentworthvilleweather.com" my server username
$dbpassword = "xxxxxx" my server password
$database = "wentydb"

Is this the correct way?