diff options
author | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-22 20:45:43 -0700 |
---|---|---|
committer | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-22 20:45:43 -0700 |
commit | df49a36e140acc211fdc31480d40281404110310 (patch) | |
tree | 3a25af561ed3703ad5df8cf90d9f56d8824f7a4f /index.php |
Inital commit with existing code
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 31 |
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 |