-
Notifications
You must be signed in to change notification settings - Fork 2
/
updatestation.php
69 lines (46 loc) · 1.25 KB
/
updatestation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<title>Entries flagged to be shown or multiple data-actions-box=\"true\"</title>
<meta name="description" content="">
<meta name="author" content="">
</head>
<body>
<?php include_once("header.php");?>
<div class="container">
<div class="text-center">
<h1>Marine</h1>
<p class="lead">Confirmation of changed values</p>
</div>
</div>
<div class="container">
<?php
$SID=$_POST['SID'];
$Sname=$_POST['Sname'];
$Ssequence=$_POST['Ssequence'];
$Slongitude=$_POST['Slongitude'];
$Slatitude=$_POST['Slatitude'];
$servername = "localhost";
$username="root";
$password="LIMS.2017.Uppsala";
$dbname = "Marine";
$thetable="Biological";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "UPDATE Stations
SET Sname='$Sname', Ssequence=$Ssequence,Slongitude=$Slongitude,Slatitude=$Slatitude
WHERE SID=$SID";
if (mysqli_query($conn, $sql)) {
echo "Entry changed successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
</div><!-- /.container -->
</body>
</html>