summaryrefslogtreecommitdiffstats
path: root/Website
diff options
context:
space:
mode:
Diffstat (limited to 'Website')
-rw-r--r--Website/insert.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/Website/insert.php b/Website/insert.php
new file mode 100644
index 0000000..1d7ef8f
--- /dev/null
+++ b/Website/insert.php
@@ -0,0 +1,21 @@
+<?php
+$con = mysql_connect("localhost","peter","abc123");
+if (!$con)
+ {
+ die('Could not connect: ' . mysql_error());
+ }
+
+mysql_select_db("my_db", $con);
+
+$sql="INSERT INTO temptasktable (FirstName, LastName, Age)
+VALUES
+('$_POST[from]','$_POST[destination]','$_POST[timestamp]')";
+
+if (!mysql_query($sql,$con))
+ {
+ die('Error: ' . mysql_error());
+ }
+echo "1 record added";
+
+mysql_close($con)
+?> \ No newline at end of file