From df49a36e140acc211fdc31480d40281404110310 Mon Sep 17 00:00:00 2001 From: Cflip <36554078+cflip@users.noreply.github.com> Date: Fri, 22 Jan 2021 20:45:43 -0700 Subject: Inital commit with existing code --- topic.php | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 topic.php (limited to 'topic.php') diff --git a/topic.php b/topic.php new file mode 100644 index 0000000..216211f --- /dev/null +++ b/topic.php @@ -0,0 +1,57 @@ +

' . $row['topic_subject'] . '

'; + echo 'Created by ' . $row['user_name'] . ' on ' . date('M d, Y', strtotime($row['topic_date'])) . ''; + $topic_id = $row['topic_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_topic = " . 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 topic 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'] . '
'; + + echo ' +
+
+

Reply to this thread

+ +
+ +
+
'; +} + +mysqli_free_result($result); + +include 'footer.php'; \ No newline at end of file -- cgit v1.2.3