diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-03-21 10:54:47 -0600 |
---|---|---|
committer | cflip <36554078+cflip@users.noreply.github.com> | 2021-03-21 10:54:47 -0600 |
commit | 2805ef7311eeb028cd48bffe04a705676c4682be (patch) | |
tree | 59c00c77d5bd59ea89967f18d5bcd6d1b5ad6e01 /all-posts.php | |
parent | f83530a122119d7f69812493f9c2f4987ccb2065 (diff) |
big changes pt1
Diffstat (limited to 'all-posts.php')
-rw-r--r-- | all-posts.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/all-posts.php b/all-posts.php new file mode 100644 index 0000000..fabeb3c --- /dev/null +++ b/all-posts.php @@ -0,0 +1,28 @@ +<?php session_start()?> +<!DOCTYPE html> +<html> +<head> + <title>All posts - cflip.net forum</title> +</head> +<body style="width: 720px;margin: auto;"> + <?php include_once 'templates/header.php'; ?> + <h2>All Posts</h2> + <?php + include_once 'includes/db_inc.php'; + include_once 'includes/functions_display.php'; + + $sql = "SELECT post_id, post_content, post_date, post_author, user_id, user_name FROM posts LEFT JOIN users ON post_author = user_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 forum has no posts'; + } else { + display_posts($dbc, 1, $result); + } + ?> +</body> +</html>
\ No newline at end of file |