-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotices.php
More file actions
40 lines (35 loc) · 926 Bytes
/
notices.php
File metadata and controls
40 lines (35 loc) · 926 Bytes
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
<?php
include"database.php";
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Notices</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>Notices</h1>
<?php
// Select all notices from the database
$sql = "SELECT * FROM notices ORDER BY created_at DESC";
$res=$db->query($sql);
//$result = mysqli_query($conn, $sql);
// Display the notices
if (mysqli_num_rows($res) > 0) {
while($row = mysqli_fetch_assoc($res)) {
echo "<div class='notice'>";
echo "<h2>" . $row["title"] . "</h2>";
echo "<p>" . $row["description"] . "</p>";
echo "<p class='created-by'>Created by " . $row["created_by"] . " on " . $row["created_at"] . "</p>";
echo "</div>";
}
} else {
echo "No notices found.";
}
//mysqli_close($conn);
?>
</div>
</body>
</html>