What?
it seems to me that you wish to query a table for a matching email address, then loop through the rows to display the data. yes?
i think that you need to use fetch() here but you can execute the query with a variable.
$sql = "SELECT * FROM comments WHERE email = :email";
$result = $pdo->query($sql);
$result->execute(array(':email' => $email));
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
echo "<div class=\"comments\">" .
"<div class=\"comment\">" . "<div class=\"ID\">" . "Post ID: " . $rows['ID'] . "</div>" .
"<div class=\"date\">" . "Posted on: " . $rows['date'] . "</div>" . "<h3>New comment by: " . $rows['email'] . "</h3>" .
"<div class=\"mood\">" . "Current mood: " . $rows['mood'] . "</div>" .
"<div class=\"comment-text\">" . "<p>" . $rows['commentText'] . "</p></div></div></div>";
}
did you try a fetch() for the row?
i’m logging off for the night…