Page 1 of 1

"Import Data" feature only processing 1st entry

Posted: Wed Jun 18, 2025 4:41 am
by SteveParry
Hi everyone.
I am using MeteoTemplate v19, and I want to upload updated weather records from Cumulus to the server WeatherDB to fill in gaps caused by network outages.

I'm using the data import function to import the daily log files from Cumulus. My host server is on PHPv8.2.

What I am getting is:

Code: Select all

Importing data from CSV/text file...

Errors will be highlighted in red...

Loading CSV/text file from https://samfordweather.com/weather/importData/combined_20250314a.txt

File loaded successfully.
No header, reading from first line.

The imported file has 41 data sets.

Import type: skip
Starting to parse data.

All ok, imported (skipped if exists): 2012-12-16 15:45
INSERT INTO alldata (DateTime,T,Tmax,Tmin,H,P,W,G,R,RR,B,S,D,A) values ('2012-12-16 15:45',33.5,33.5,33.5,38,996.00,7.0,0.0,6.10,31.00,0.0,null,17.3,34.6)
Only the first record is processed.

Looking at importFile.php, it appears that the call (line 446) to "mysqli_query($con,$query)" never returns to the script, so nothing further gets processed. (I inserted echo commands before and after this line). I have full error reporting turned on and nothing in the error log.

Code: Select all

else{
if($parameters['importType']=="skip"){
	echo "All ok, imported (skipped if exists): ".$dateTimeFormatted."<br>".$query."<hr>";
	mysqli_query($con,$query);
}
Anyone else having this issue or know how to resolve it?

Many thanks!
Cheers
...Steve

Re: "Import Data" feature only processing 1st entry

Posted: Wed Jun 18, 2025 8:37 am
by alexvanuxem
yes.

It seems that your file has no header.
Had it before, start over from the original file.
The fields and the header set up must be correct.
Use test import, it should work.

KR

Alex

Re: "Import Data" feature only processing 1st entry

Posted: Thu Jun 19, 2025 3:45 am
by SteveParry
@alexvanuxem Thanks Alex.
That's correct - there is no header, and the setting in the Import Data screen is set to "Header Row: No", so it should see the first row as data. The SQL (last line of the quoted output log) shows the first line is being picked up and submitted, but no response comes back from the mysql_query command.

Test Import worked successfully.

Just to add that I cut and paste'd the SQL to phpAdmin for the database and it worked (in that it caught that the record already exists, and therefore should be skipped by the importFile script).

Cheers
...Steve