-
Notifications
You must be signed in to change notification settings - Fork 0
/
room.php
62 lines (55 loc) · 1.65 KB
/
room.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
<!DOCTYPE html>
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
<?php
require_once('db_setup.php');
$sql = "USE jjaco16;";
if ($conn->query($sql) === TRUE) {
// echo "using Database tbiswas2_company";
} else {
echo "Error using database: " . $conn->error;
}
// Query:
$sql = "SELECT * FROM Room";
$result = $conn->query($sql);
if($result->num_rows > 0){
?>
<table class="table table-striped">
<tr>
<th>roomID</th>
<th>building</th>
<th>number</th>
<th>description</th>
<th>type</th>
</tr>
<?php
while($row = $result->fetch_assoc()){
?>
<tr>
<td><?php echo $row['roomID']?></td>
<td><?php echo $row['building']?></td>
<td><?php echo $row['number']?></td>
<td><?php echo $row['description']?></td>
<td><?php echo $row['type']?></td>
</tr>
<?php
}
}
else {
echo "Nothing to display";
}
?>
</table>
<?php
$conn->close();
?>
</body>
</html>