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 "
"; } ?>