Commit cba09894 authored by alexandru.radulescu's avatar alexandru.radulescu

Uploaded file to send data to database

parent bf547b36
<!DOCTYPE html>
<html>
<head>
<title>Data Sender</title>
</head>
</html>
<?php
//ini_set('display_errors', 1); this is for debugging purposes
$temp = $_POST["temp"];//initialise the temp and light variables
$light = $_POST["light"];
include ('Connect.php');//include the connection to the database
$query = "UPDATE PlantsTest SET TestTemp='".$temp."', TestLight='".$light."'";
//this query updates the PlantsTest table with the most recent temp and light readings
if ($db->query($query) === TRUE)//if the update was successful, print out ok
{
//echo "Ok worked";
} else
{
echo "Error updating record: " . $db->error;//if not, print out the error
}
$db->close();//close the database connection
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment