summaryrefslogtreecommitdiff
path: root/all.php
blob: dc97914a250e7ff0840b0fd27d2521701e34bd1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php 

include_once 'header.php';

include_once 'includes/db_inc.php';
include_once 'includes/functions_display.php';

$sql = "SELECT thread_id, thread_subject, thread_date, user_id, user_name, cat_id, cat_name FROM threads JOIN users ON thread_author = user_id JOIN categories ON thread_cat = cat_id ORDER BY thread_id DESC";
$result = mysqli_query($dbc, $sql);

if (!$result) {
	die('<section>Failed to fetch threads from server! <br>' . mysqli_error($dbc) . '</section>');
}

echo '<table><tr><th class="left">Latest Threads</th><th class="right">Latest Post</th></tr>';

display_threads($dbc, $result, true);
mysqli_free_result($result);

echo '</table>';

include_once 'footer.php';