forked from HFX-Co/docker-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
read.php
63 lines (53 loc) · 1.33 KB
/
read.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
<?php
if(isset($_GET["id"])){
require_once "config.php";
$sql = "SELECT * FROM employees WHERE id = " . $_GET['id'];
$result = mysqli_query($link, $sql );
if(mysqli_num_rows($result) == 1){
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$name = $row["name"];
$address = $row["address"];
$salary = $row["salary"];
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>View Record</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css">
<style type="text/css">
.wrapper{
width: 500px;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>View Record</h1>
</div>
<div class="form-group">
<label>Name</label>
<p class="form-control-static"><?php echo $row["name"]; ?></p>
</div>
<div class="form-group">
<label>Address</label>
<p class="form-control-static"><?php echo $row["address"]; ?></p>
</div>
<div class="form-group">
<label>Salary</label>
<p class="form-control-static"><?php echo $row["salary"]; ?></p>
</div>
<p><a href="index.php" class="btn btn-primary">Back</a></p>
</div>
</div>
</div>
</div>
</body>
</html>