Initial commit - mini cms final

This commit is contained in:
Aya Tess tess
2025-11-03 21:53:58 +01:00
parent a366336dc1
commit a01f620ef9
14 changed files with 422 additions and 197 deletions

View File

@@ -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);