-
Notifications
You must be signed in to change notification settings - Fork 1
/
user_list.php
49 lines (42 loc) · 1.58 KB
/
user_list.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
<?php
include "header.php";
include "navigation.php";
?>
<div class="container-fluid mt-3">
<div class="row">
<div class="col-12">
<table class="table table-md table-bordered bg-light">
<thead class="bg-dark text-light">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php
require "connection.php";
$sql = "SELECT * FROM users";
$fire = $conn->prepare($sql);
$fire->execute();
if ($fire->rowCount() > 0) {
$results = $fire->fetchAll(PDO::FETCH_ASSOC);
foreach ($results as $result) {
echo '<tr>';
echo '<td>'. $result['first_name'] .'</td>';
echo '<td>'. $result['last_name'] .'</td>';
echo '<td>'. $result['email'] .'</td>';
echo '</tr>';
}
} else {
echo '<tr>';
echo '<td> No Data Found. </td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php include "footer.php"; ?>