$sql= "SELECT date_posted, author, text
FROM comments WHERE note = ?
ORDER BY date_posted DESC";
$result = $this->query($sql, 'd', $this->id);
$sql= "SELECT date_posted, author, text
FROM comments WHERE note = ?
ORDER BY date_posted DESC";
$result = $this->query($sql, 'd', $this->id);
- $date_posted = $entry['date_posted'];
- $author = $entry['author'];
- $text = htmlspecialchars($entry['text']);
- $head = "<h3>" . htmlspecialchars($author) . "</h3>";
- echo "<div class='comment'>";
- echo $head;
- echo $text;
- echo "</div>";
+ $this->comment[$i]['date_posted'] = $entry['date_posted'];
+ $this->comment[$i]['author'] = $entry['author'];
+ $this->comment[$i]['text'] = htmlspecialchars($entry['text']);
+ $this->comment[$i]['head'] = "<h3>" . htmlspecialchars($author) . "</h3>";
+ $i++;