-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathview-users.php
More file actions
39 lines (37 loc) · 1.2 KB
/
Copy pathview-users.php
File metadata and controls
39 lines (37 loc) · 1.2 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
<?php
session_start();
if (!isset($_SESSION['username'])):
header('Location:login.php');
else :
include("config/db.php");
include("include/header.php");
?>
<div class="container">
<h1 style="text-align: center;">List of all the Students</h1>
<div class="cards" id="data">
<?php
$sql = "SELECT * FROM users WHERE user_role = 0";
$result = mysqli_query($conn, $sql) or die('Error');
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$id = $row['id'];
$username = $row['username'];
$email = $row['email'];
?>
<div class="card">
<h2><?php echo $username ?></h2>
<h3><?php echo $email ?></h3>
</div>
<?php
}
}
else {
$error = 'No Students found';
}
?>
</div>
</div>
<?php
include("include/footer.php");
endif
?>