' . $row['thread_subject'] . '

'; echo 'Created by ' . $row['user_name'] . ' on ' . date('M d, Y', strtotime($row['thread_date'])) . ''; $thread_id = $row['thread_id']; } } echo ''; mysqli_free_result($result); $sql = "SELECT post_content, post_date, post_author, user_id, user_name FROM posts LEFT JOIN users ON post_author = user_id WHERE post_thread = " . mysqli_real_escape_string($dbc, $_GET['id']); $result = mysqli_query($dbc, $sql); if (!$result) { die('Error trying to display posts: ' . mysqli_error($dbc)); } if (mysqli_num_rows($result) == 0) { echo '
This thread has no posts
'; } else { echo ''; while ($row = mysqli_fetch_assoc($result)) { echo ''; echo ''; } echo '
Posted by ' . $row['user_name'] . '
' . date('m/d/Y g:ia', strtotime($row['post_date'])) . '
' . $row['post_content'] . '
'; } mysqli_free_result($result); if (isset($_SESSION['signed_in'])) { echo '

Reply to this thread


'; } else { echo '
Sign in to reply to this thread
'; } include_once 'footer.php'; ?>