-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoticeprint.php
38 lines (35 loc) · 1.02 KB
/
noticeprint.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
<?php
include("./php/database.php");
$sql = "SELECT * FROM notices";
$result = $conn->query($sql);
if ($result && $result->num_rows > 0) {
// Start building the table HTML
$tableHTML = "<table border='1'>
<tr>
<th>Sr.No</th>
<th>Title</th>
<th>Date</th>
<th>Upload Till</th>
<th>Year</th>
<th>Category</th>
</tr>";
// Loop through the result set and add rows to the table HTML
while ($row = $result->fetch_assoc()) {
$tableHTML .= "<tr>
<td>{$row['SrNo']}</td>
<td>{$row['TITLE']}</td>
<td>{$row['DATE']}</td>
<td>{$row['UPLOAD_TILL']}</td>
<td>{$row['YEAR']}</td>
<td>{$row['CATEGORY']}</td>
</tr>";
}
// Close the table HTML
$tableHTML .= "</table>";
// Output the table HTML
echo $tableHTML;
} else {
// If no notices found, display a message
echo "<p>No notices found.</p>";
}
?>