summaryrefslogtreecommitdiff
path: root/index.php
blob: 03069b7a765e2fac3ec6093085f2a9517c232f5d (plain)
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
<?php
include_once 'header.php';
?>
	<table>
		<tr>
			<th class="left">Category</th>
			<th class="right">Latest Thread</th>
		</tr>
<?php
	include_once 'includes/db_inc.php';

	$sql = "SELECT cat_id, cat_name, cat_description FROM categories";
	$result = mysqli_query($dbc, $sql);

	if (!$result) {
		die('Failure trying to display categories: ' . mysqli_error($dbc));
	}

	while ($row = mysqli_fetch_assoc($result)) {
		echo '<tr><td class="left">';
		echo '<h4><a href="category.php?id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a></h4>';
		echo $row['cat_description'];
		echo '</td><td class="right">Example thread<br><small>1 hour ago by <b>example user</b></small></td></tr>';
	}

	mysqli_free_result($result);
?>
	</table>
<?php
include_once 'footer.php';
?>