Page 1 of 2

ImportCumulusFile_v2-3.php

Posted: Mon 26 Feb 2018 6:25 pm
by Dennisdg
I have an error log on my hosting provider quote

[26-Feb-2018 00:11:50 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/*****/public_html/ImportCumulusFile_v2-3.php on line 234
Capture1.JPG
What should be changed from and to?

Thanks

I have changed msql to mysqli

Hope that corrects the error.

Re: ImportCumulusFile_v2-3.php

Posted: Mon 26 Feb 2018 7:04 pm
by PaulMy
Not sure if I am correct as I am just learning about the same thing when I changed to PHP version 7.x
Change mysql to mysqli

Enjoy,
Paul

Re: ImportCumulusFile_v2-3.php

Posted: Mon 26 Feb 2018 7:51 pm
by mcrossley
That's an old version of the script! Version 3.0 is in the wiki, it uses mysqli and a more efficient bulk insert scheme.

Re: ImportCumulusFile_v2-3.php

Posted: Mon 26 Feb 2018 8:45 pm
by Dennisdg
Thanks both.

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 12:53 pm
by Dennisdg
Mark

Request help please with ImportCumulusFile_3.0.php
Trying to test the import with my browser, http://www.g4glp.co.uk/ImportCumulusFil ... ayfile.txt
I get the following error
Error.JPG
Here are the edited changes to ImportCumulusFile_v3-0.php
3_0.JPG
The command for v2-3, http://www.g4glp.co.uk/ImportCumulusFil ... ayfile.txt
This is what I use in version 2_3
2_3.JPG
Version 2_3 currently populates the SQL db fine using but with the error message shown at the start of this thread.

Thanks in anticipation

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 2:31 pm
by mcrossley
I really need to see the server error log to determine what has gone wrong there. Error 500 could be anything. :(

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 3:41 pm
by Dennisdg
The server is responding its not able to capture errors for v3-0 just returning the error to my browser.

I've just tried both v2-3 and 3-0
Error log from server
error_log.txt
Only v2-3 shown

As v2-3 populates correctly please show me what to change to get msqli accepted.

Tks

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 4:13 pm
by sfws
I will leave Mark to decide if he wants to reply once more about his script since you have not provided the V3.0 information he requested, but earlier in this thread PaulMy made reference to similar problems he had that were discussed at https://cumulus.hosiene.co.uk/viewtopic.p ... 16#p129269, have you read that exchange?

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 4:43 pm
by Dennisdg
No I hadn't seen that thread. Thanks.

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 5:10 pm
by mcrossley
I haven't run that script in a long time, but just tried it on my Pi running PHP 7.0 and get an error 500 too. So I'll have look and see what can be done...

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 5:15 pm
by Dennisdg
Thank you.

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 5:50 pm
by mcrossley
Sent a test version via PM, it now works for me. Note that this version of the script does not need the "table" parameter, you set that within the script itself.

Re: ImportCumulusFile_v2-3.php

Posted: Thu 01 Mar 2018 6:25 pm
by Dennisdg
I've sent you a PM with my result!

Re: ImportCumulusFile_v2-3.php

Posted: Mon 27 Apr 2020 12:58 pm
by Sadgit
old thread but best I could find and didn't want to start yet another one :)

I get 500 errors for all version 3's but not 2.8.

Re: ImportCumulusFile_v2-3.php

Posted: Mon 27 Apr 2020 3:36 pm
by Mapantz
I haven't used the import for a while as everything is tikiti-boo. I did run it back several months to see if it worked OK..

Running from web server
Script start: 27/04/20 - 15:34:25
Importing file: Data/Dec19log.txt, To table: Monthly ...
Connected to database OK.
Set MySQL TZ OK.
Processing monthfile...
Target table already exists.
Prepared SQL statement OK.
Inserting data...
Data insert done, 1 rows inserted
Script complete: 27/04/20 - 15:34:26
Execution time: 0.5 secs


That's version 3.2 on PHP v7.3.16

Looks all good?!