From a2efbb6d413834bf686425dacc87f83a880368b7 Mon Sep 17 00:00:00 2001 From: Jakob Date: Sun, 8 Mar 2020 15:03:30 +0100 Subject: [PATCH] added php to display all posts from our database --- threadr/board/board.php | 42 ++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/threadr/board/board.php b/threadr/board/board.php index 6cc4f2e..3dbdbe5 100644 --- a/threadr/board/board.php +++ b/threadr/board/board.php @@ -1,13 +1,29 @@ -
-

Lorem ipsum

-
-
-
-

Lorem ipsum blabblabludbjfdla

-
-
-
-

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

-
-
-
+

Public Boards

'; + $statement = $pdo->prepare("SELECT * FROM posts WHERE board_id=$id ORDER BY post_time asc"); + $statement->execute(); + foreach($statement->fetchAll() as $ROW) { + echo "
" + echo "

$ROW[id]

" + echo "
" + echo "
" + echo "
" + echo "

$ROW[user_id]

" + echo "
" + echo "
" + echo "
" + echo "

$ROW[content]

" + echo "
" + echo "
" + echo "
" + } +} +if (!$result) { + $error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2]; +} +?> +