-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubscriptions.php
65 lines (53 loc) · 1.81 KB
/
subscriptions.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
64
65
<?php
//Conect Database
include('./db_connect.php');
//write queries for all the subscribers
$sql = 'SELECT id, email, created_at from subscriptions';
//make query
$results = mysqli_query($conn, $sql);
//fetch the resulting rows as an array
$users = mysqli_fetch_all($results, MYSQLI_ASSOC);
// free the memory
mysqli_free_result($results);
// close connection with the DB
mysqli_close($conn);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--Favicon-->
<link rel="shortcut icon" href="./assets/images/mobileLogo.svg" type="image/x-icon">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<title> RescueCall | Subscriptions</title>
</head>
<body>
<h1 class="text-center my-5"> Subscription to RescueCall</h1>
<table class="table table-striped w-75 mx-auto">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Email</th>
<th scope="col">Created_at</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user) : ?>
<tr>
<th scope="row">
<?php echo htmlspecialchars($user['id']); ?>
</th>
<td>
<?php echo htmlspecialchars($user['email']); ?>
</td>
<td>
<?php echo htmlspecialchars($user['created_at']); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</body>
</html>