-
Notifications
You must be signed in to change notification settings - Fork 2
/
updatebiological.php
75 lines (50 loc) · 1.44 KB
/
updatebiological.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
70
71
72
73
74
75
<!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
$BID=$_POST['BID'];
//$Bstationname=$_POST['Bstationname'];
$Bstratummin=$_POST['Bstratummin'];
$Bstratummax=$_POST['Bstratummax'];
$Bx=$_POST['Bx'];
$B_y=$_POST['B_y'];
$Blarvastage=$_POST['Blarvastage'];
$Bspecies=$_POST['Bspecies'];
$Babundance=$_POST['Babundance'];
$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 $thetable
SET Bstratummin=$Bstratummin,Bstratummax=$Bstratummax,Bx=$Bx,B_y=$B_y,Blarvastage='$Blarvastage',Bspecies='$Bspecies',Babundance=$Babundance
WHERE BID=$BID";
if (mysqli_query($conn, $sql)) {
echo "Entry changed successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
</div><!-- /.container -->
</body>
</html>