I’m stuck trying to figure out how to display the currently logged in users posts, but only their posts in their profile page. They are able to log in and the session appears to work, but i’m struggling trying to pull only that users posts based on their session information. this is where i’m at so far.
$id = $_SESSION['email'];
if ($id) {
$stmt = $pdo->prepare("SELECT * FROM posts WHERE member_id=:member_id");
$stmt->execute([$id]);
// $posts = $stmt->fetch();
$posts = $stmt->fetchAll(PDO::FETCH_ASSOC);