Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoT Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alexandru.radulescu
IoT Project
Commits
cba09894
Commit
cba09894
authored
Jan 17, 2022
by
alexandru.radulescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uploaded file to send data to database
parent
bf547b36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
SendData.php
SendData.php
+27
-0
No files found.
SendData.php
0 → 100644
View file @
cba09894
<!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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment