<?php
require "BrabimBaskota_2331410_connection.php";
$id=$_REQUEST["id"];
$city=$_REQUEST["city"];
$day=$_REQUEST["day"];
$temperature=$_REQUEST["temperature"];
$min=$_REQUEST["min"];
$max=$_REQUEST["max"];
$humidity=$_REQUEST["humidity"];
$description=$_REQUEST["description"];
$query = "INSERT INTO sdays VALUES('$id','$city', '$day', '$temperature','$min','$max','$humidity','$description')
ON DUPLICATE KEY UPDATE city=VALUES(city), day=VALUES(day),temp=VALUES(temp),min=VALUES(min), max=VALUES(max),
humidity=VALUES(humidity), description=VALUES(description);";
if ($con->query($query)=== TRUE) {
echo "Succesfully inserted";
}
$con->close();
?>