prepare($query); $stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT); $stmt->execute(); // Get profile information from query result $result = $stmt->fetch(PDO::FETCH_ASSOC); $name = $result['name']; $email = $result['email']; $avatar = $result['avatar']; // Display profile information on page echo "$name
"; echo ""; echo "Email: $email
"; ?>
prepare($query); $stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT); $stmt->execute(); // Display posts on page while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $title = $row['title']; $content = $row['content']; $date = $row['date']; echo "$title
"; echo "$content
"; echo "Posted on $date"; } ?>
prepare($query); $stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT); $stmt->execute(); // Display activity log on page echo "