Page 4 of 4

Re: Realtime and mysql download available.

Posted: Tue 04 Dec 2012 4:16 pm
by mcrossley
If anyone is interested I have added the ability to create and log to a "realtime" table to the ImportCumulusFile.php script in the Wiki - http://wiki.sandaysoft.com/a/ImportCumulusFile

Re: Realtime and mysql download available.

Posted: Tue 04 Dec 2012 5:02 pm
by kc2kzz
Now that is working for me.

Re: Realtime and mysql download available.

Posted: Tue 04 Dec 2012 8:49 pm
by gemini06720
Mark, I am somewhat disappointed in the latest modifications and release of the 'ImportCumulusFile' script:
  • - syntax error, unexpected '{' in ImportCumulusFile.php on line 195
    - syntax error, unexpected '{' in ImportCumulusFile.php on line 197

Then, once those two two lines have been corrected:
  • - Undefined index: file in ImportCumulusFile.php on line 101
    - Undefined index: table in ImportCumulusFile.php on line 102
    - Undefined index: type in ImportCumulusFile.php on line 103

Some testing code should be added to the script (even if those few lines of code were not part of the original script) - the presence of command line parameters should be tested and, if none are supplied, then either have some predefined default values for the variables or issue an error message regarding the missing parameters...

Expecting a user to read and understand the included documentation should not to be taken for granted...

Re: Realtime and mysql download available.

Posted: Tue 04 Dec 2012 10:58 pm
by mcrossley
Now you know why I don't write a great deal of PHP ;)

Version 1.4a posted, fixes the two syntax errors :oops: (I had the syntax error panel of my editor hidden), and adds parameter presence checking.

Re: Realtime and mysql download available.

Posted: Wed 05 Dec 2012 12:50 am
by gemini06720
Come on Mark, PHP is way simpler to write (and check the syntax) than JavaScript is and will ever be... :mrgreen:

Re: Realtime and mysql download available.

Posted: Thu 23 May 2013 5:45 pm
by laulau
Hello,
I'm trying to create a mysql database with this scripts.
The database creation is ok but i can't fill it with realtime.txt values !

first question:

in real.php i found this part of code:

Code: Select all

 for ( $i = 0;$i < count( $linearray );$i++ ) {
        echo $linearray[$i]."\n";
		if ( strpos( $linearray[$i], "-" ) !== false  ) {
		
            $tmp_date = explode( "-", $linearray[$i] );

            $linearray[$i] = $tmp_date[2] . "-" . $tmp_date[1] . "-" . $tmp_date[0];
            $i = count( $linearray );
			
        }
		
    }
What is this for ?
Second question:
in the begining of the script i found

Code: Select all

$addauto = 1;
what does it do ?

here's my realtime.txt

Code: Select all

23/05/13 19:41:12 9.9 47 -0.9 7.2 5.8 259 0.0 0.0 1010.0 O 2 km/h C mb mm 140.9 +0.3 40.0 195.0 7.0 17.9 53 9.1 +0.3 13.9 11:45 8.0 06:15 25.6 14:33 36.7 14:32 1016.0 00:00 1007.0 13:12 1.9.4 1065 12.2 9.9 9.9 0 0.00 0 244 0.0 6 1 0 OSO 1346 m 6.4 0.0 116 0 
my date separator is / in in wind unit (km/h) there is also a / ; can this affect the script ?
Thank's

Re: Realtime and mysql download available.

Posted: Thu 23 May 2013 6:19 pm
by tobyspond
Hi Laurent,

I'm not sure if this is your problem, but in order to populate a table in your database you need to call the script. I use a cron job to accomplish that.

Kerry

Re: Realtime and mysql download available.

Posted: Thu 16 Apr 2015 7:49 pm
by ant30
Hello,
Im new here and i need a little help.
Im hosting my website on serversfree.com and i have one problem to solve with Cron Job.

Path to Cron Job command to run : php -f /home/u464811711/public_html/real.php

I have created mysql table with this script on this topic and its all ok.
Mysql table "realtime" is created and "realtime.txt" is ok.
http://ravne.bugs3.com/realtime.txt
Everything is working good if i run "real.php" with my browser and data are writen in table realtime. But nothing heppening with cron job.

Thanks for help.

Re: Realtime and mysql download available.

Posted: Fri 17 Apr 2015 10:42 am
by mcrossley
Is the path to the realtime file correct when running it as a cron job, it may be different from running from the web server. I'd use a full path from root.

Re: Realtime and mysql download available.

Posted: Fri 17 Apr 2015 4:07 pm
by ant30
thanx mcrossley

Path is always important :oops:
My path to the command for cron job "real.php" was wrong :groan:

...and now Im on the right path :clap:
It works :idea:

Re: Realtime and mysql download available.

Posted: Thu 29 Mar 2018 12:32 pm
by dazza1223
hey guys um is set all this up but it come to the pont where i got to include the database.php but nothing shows up ?