Du musst dich zuerst Einloggen oder Regestrieren
Hier Einloggen
Hier Regestrieren"); } include 'db_connect.php'; try { $userId = $_SESSION['user_id']; $stmt1 = $pdo->prepare("SELECT username, email, created_at FROM users WHERE id = :id"); $stmt1->execute([':id' => $userId]); $user = $stmt1->fetch(PDO::FETCH_ASSOC); $stmt2 = $pdo->prepare("SELECT file_path FROM profile_pictures WHERE user_id = :user_id"); $stmt2->execute([':user_id' => $userId]); $profile_pic = $stmt2->fetch(PDO::FETCH_ASSOC); $stmt3 = $pdo->prepare(" SELECT users.username, profile_pictures.file_path FROM users LEFT JOIN profile_pictures ON users.id = profile_pictures.user_id ORDER BY profile_pictures.uploaded_at DESC "); $stmt3->execute(); $users = $stmt3->fetchAll(PDO::FETCH_ASSOC); if ($profile_pic) { $profile_image = $profile_pic['file_path']; } else { $profile_image = 'profile-pics/default.jpeg'; } if(!$user){ die("Benutzer nicht gefunden!"); } }catch (PDOException $e){ die("Fehler: " . $e->getMessage()); } ?> '; ?> Profile

Willkommen, !

Email: !

Regestriert seit:, !

Abmelden Posts Über mich Einstellungen
Posts "; }elseif($page == 'about'){ echo "

Über mich

"; }elseif($page == 'settings'){ echo "

Einstellungen

Profilbild änderen


Profilbild löschen

"; echo $profile_image; } ?>
"; $stmt45 = $pdo->prepare(" SELECT posts.*, profile_pictures.file_path AS profile_picture, users.username FROM posts LEFT JOIN profile_pictures ON posts.user_id = profile_pictures.user_id LEFT JOIN users ON posts.user_id = users.id WHERE posts.user_id = :user_id ORDER BY posts.created_at DESC "); $stmt45->execute([':user_id' => $userId]); $posts = $stmt45->fetchAll(PDO::FETCH_ASSOC); } ?>

User # schrieb:

Bild zum Post

Erstellt am: