I know this is an obvious question, but I cannot find an answer!
At the moment the page simpyl displays nothing if there are no comments in the database. I would like it to display something like 'There are no comments yet.'. This is the code for displaying the comments:
Code:
$display_comments = @mysql_query("SELECT commentsunique, commentsid, name, comment FROM comments WHERE commentsid='$contentid' ORDER BY commentsunique DESC");
while ($comments = mysql_fetch_array($display_comments)) {
$commentid = $comments['commentsid'];
$name = $comments['name'];
$comment = $comments['comment'];
echo '<h5 class="commentsname">' . $name . '</h5>';
echo '<p class="commentstext">' . $comment . '</p>';
It would be something like:
Code:
IF (there are no comments) {
echo '<p>No comments</p>';
} else {
display comments...
}
Thank you!