***closed*** weather34 for WeatherDisplay (clientraw and WDapi)

Step 1: save the uploaded data which is put after the URL by WD in the form URL?d=all_your_data_fields
The first part of the return message “succes” signals that some data (at least 50 characters) was received and is saved as a text-string for later use
2. Then the WDapi checks if a database exits “If not” the script ends.
You have set you will use a database so the settings are read to check if WDapi needs to upload to the database
The database name, password a.s.o. are checked if they are not empty, if empty the script ends without a message.
Then it checks if “WDapi or the cronjob” must upload. If the cronjob should do it => no message and the WDapi script ends.

  1. The WDapi script connects to the database, in your case the connection is OK, otherwise there would have been an error message

  2. The fields for the database are created from the text string
    AND NOW the data is inserted in the database

$result = mysqli_query($conn,"INSERT INTO weatherstation(time, outsideTemp, barometer, raintoday, UV, windgust, windSpeed, radiation, dewpoint, rainrate, direction, date, lightning)
VALUES('$updated', '$temp', '$barometer', '$raintoday', '$uv', '$windgust', '$windspeed', '$solar', '$dewpoint', '$rainrate', '$direction', '$date', '$lightning')");	
if ($result == false) 
     { die ('Bad Data: '. mysqli_connect_error()); }

The only thing which does not works is the insert, probably the credentials for the userid are set to low.
I will read the documentation to find a better clue what is wrong, as the error message displayed is empty, try the attached replacement script
Use PHPADMIN or your cPanel and give this weather34 user all credentials possible.

Check http://wd34.weather-template.com//documentation/WD34-SQL-2019-01.pdf point 2.1: you could try load some data with PHPadmin, just to see if there is an error message.

When you use the WDapi in your browser you get those messages as the fields are not available URL?d=all_your_data_fields


w34_WDapi.php.zip (2.21 KB)