summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..2936a89
--- /dev/null
+++ b/index.php
@@ -0,0 +1,31 @@
+<?php
+include_once 'header.php';
+?>
+ <table>
+ <tr>
+ <th class="left">Category</th>
+ <th class="right">Latest Topic</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 topic right here<br><small>1 hour ago by <b>cflip</b></small></td></tr>';
+ }
+
+ mysqli_free_result($result);
+?>
+ </table>
+<?php
+include_once 'footer.php';
+?> \ No newline at end of file