13 lines
469 B
PHP
13 lines
469 B
PHP
<?php
|
|
include 'db.php';
|
|
|
|
if (isset($_GET['love_wall_id'])) {
|
|
$love_wall_id = $_GET['love_wall_id'];
|
|
$stmt = $pdo->prepare("SELECT comments.content, users.username FROM comments JOIN users ON comments.user_id = users.id WHERE love_wall_id = ? ORDER BY comments.created_at DESC");
|
|
$stmt->execute([$love_wall_id]);
|
|
while ($row = $stmt->fetch()) {
|
|
echo "<div class='comment'><strong>{$row['username']}:</strong> {$row['content']}</div>";
|
|
}
|
|
}
|
|
?>
|