-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.php
More file actions
98 lines (91 loc) · 1.57 KB
/
Copy pathdisplay.php
File metadata and controls
98 lines (91 loc) · 1.57 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
</head>
<body style="background-color:#e9f7f9">
<h1 style="table-dark">Display</h1>
<table class="table table-dark">
<thead>
<tr>
<th>ID</th>
<th>Fist_Name</th>
<th>Last_Name</th>
<th>Address</th>
<th>Age</th>
<th>City</th>
<th>Number_of_vehicles</th>
<th>Mobile_Number</th>
</tr>
</thead>
<tbody>
<?php
$servername = "localhost";
$username = "root";
$password = "mysql";
$dbname = "f20160250db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM Users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
?>
<tr>
<td>
<?php
echo $row["ID"];
?>
</td>
<td>
<?php
echo $row["First_Name"]
?>
</td>
<td>
<?php
echo $row["Last_Name"]
?>
</td>
<td>
<?php
echo $row["Address"]
?>
</td>
<td>
<?php
echo $row["Age"]
?>
</td>
<td>
<?php
echo $row["City"];
?>
</td>
<td>
<?php
echo $row["Number_of_vehicles"];
?>
</td>
<td>
<?php
echo $row["Mobile_Number"];
?>
</td>
</tr>
<?php
}
} else {
echo "0 results";
}
$conn->close();
?>
</tbody>
</table>
</body>
</html>