summaryrefslogtreecommitdiffstats
path: root/Website/insert.php
blob: 1d7ef8f36727b9301b288fae215ee708e400a073 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
?>