Initial commit - mini cms final
This commit is contained in:
@@ -10,13 +10,11 @@ if ($id <= 0) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// fetch user
|
||||
$stmt = $pdo->prepare("SELECT id, username, bio, profile_picture FROM utilisateurs WHERE id = ?");
|
||||
$stmt->execute([$id]);
|
||||
$u = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (!$u) { echo "Utilisateur introuvable."; exit; }
|
||||
|
||||
// fetch posts by user
|
||||
$stmt2 = $pdo->prepare("SELECT id, title, content, image_url, date_creation FROM posts WHERE user_id = ? ORDER BY date_creation DESC");
|
||||
$stmt2->execute([$id]);
|
||||
$posts = $stmt2->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
Reference in New Issue
Block a user