From 06d085859e158367247153a6a1dfa8a1812dba81 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Thu, 12 Mar 2020 23:03:13 +0100 Subject: [PATCH] removed dead code --- threadr/board/board.php | 52 +++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/threadr/board/board.php b/threadr/board/board.php index dd3e880..d29a57e 100644 --- a/threadr/board/board.php +++ b/threadr/board/board.php @@ -1,38 +1,24 @@ prepare("SELECT * FROM posts WHERE board_id=:bid ORDER BY post_time asc"); - $statement->execute(array("bid"=>$id)); - foreach($statement->fetchAll() as $ROW) { - $error = false; - $error_message = ""; - if (!$error) { - $statement = $pdo->prepare("SELECT * FROM users WHERE id=:uid"); - $statement->execute(array("uid"=>$ROW[user_id])); - $post_user = $statement->fetch(); - } - if (!$result) { - $error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2]; - } - echo "
"; - echo "

$ROW[title]

"; - echo "
"; - echo "
"; - echo "
"; - echo "

$post_user[name]

"; - echo "
"; - echo "
"; - echo "
"; - echo "

$ROW[content]

"; - echo "
"; - echo "
"; - echo "
"; - } -} -if (!$result) { - $error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2]; +$statement = $pdo->prepare("SELECT * FROM posts WHERE board_id=:bid ORDER BY post_time asc"); +$statement->execute(array("bid"=>$id)); +foreach($statement->fetchAll() as $ROW) { + $statement = $pdo->prepare("SELECT * FROM users WHERE id=:uid"); + $statement->execute(array("uid"=>$ROW[user_id])); + $post_user = $statement->fetch(); + echo "
"; + echo "

$ROW[title]

"; + echo "
"; + echo "
"; + echo "
"; + echo "

$post_user[name]

"; + echo "
"; + echo "
"; + echo "
"; + echo "

$ROW[content]

"; + echo "
"; + echo "
"; + echo "
"; } ?>