iwa-panda1

Manage Weather Data by International Weather Agency (Version 1)
Log | Files | Refs

commit 5d5c7a01fed719b370f4b45721a3c1cc11d699f9
parent a1b4ed874fa8695c408f5e9fb7e13c665f194465
Author: Kninteman <[email protected]>
Date:   Sun, 26 Mar 2023 15:53:28 +0200

Update datainserter.php

Gecorrigeerde weerdata update

Diffstat:
Mdatainserter.php | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/datainserter.php b/datainserter.php @@ -77,8 +77,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $sql2 = "SELECT data_id from weerdata where station_name = ? and datum_tijd = ?"; $stmt2 = mysqli_prepare($db_connection, $sql2); mysqli_stmt_bind_param($stmt2, "is", $stn, $datetime); - $result = mysqli_stmt_execute($stmt2); - $row = mysqli_fetch_assoc($result); + $stmt2->execute(); + $result = $stmt2->get_result(); + $row = $result->fetch_assoc(); $data_id = $row['data_id']; $sql3 = "INSERT INTO weerdata_gecorrigeerd (station_name, origin_data_id, datum_tijd,gevalideerd,temp,dauwpunt,ldrk_znv,ldrk_station,zichtbaarheid, @@ -86,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmt3 = mysqli_prepare($db_connection, $sql3); $falsevalid = 1; - mysqli_stmt_bind_param($stmt3, "iisiddddddddsiiiiiidi", $stn, $result, $datetime, $falsevalid, $temp, $dewp, $stp, $slp, $visib, $wdsp, $prcp, $sndp, $frshtt, $vorst,$regen,$sneeuw,$hagel,$onweer,$tornado, $cldc, $wnddir); + mysqli_stmt_bind_param($stmt3, "iisiddddddddsiiiiiidi", $stn, $data_id, $datetime, $falsevalid, $temp, $dewp, $stp, $slp, $visib, $wdsp, $prcp, $sndp, $frshtt, $vorst,$regen,$sneeuw,$hagel,$onweer,$tornado, $cldc, $wnddir); $result = mysqli_stmt_execute($stmt3); }