threadr.lostcave.ddnss.de/threadr/board/board.php

29 lines
827 B
PHP
Raw Normal View History

<?php
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false;
$error_message = "";
if (!$error) {
2020-03-08 15:20:06 +01:00
$statement = $pdo->prepare("SELECT * FROM posts WHERE board_id='$id' ORDER BY post_time asc");
$statement->execute();
foreach($statement->fetchAll() as $ROW) {
echo "<section>"
2020-03-08 15:18:55 +01:00
echo "<h1>$ROW[id]</h1>"
echo "<article>"
echo "<header>"
echo "<div>"
echo "<p class='beige'>$ROW[user_id] <time datetime='$ROW[post_time]'>$ROW[post_time]</time></p>"
echo "</div>"
echo "</header>"
echo "<div class='postcontent'>"
echo "<p>$ROW[content]</p>"
echo "</div>"
echo "</article>"
echo "</section>"
}
}
if (!$result) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
?>