Here is my code:
Expand|Select|Wrap|Line Numbers
- echo "
- <link rel=\"stylesheet\" type=\"text/css\" href=\"comments.css\"/>
- ";
- $commentquery = mysql_query("SELECT * FROM comments WHERE tutorialid='$tutid' ORDER BY date DESC") or die(mysql_error());
- $commentNum = mysql_num_rows($commentquery);
- echo "<div id=\"currentcomments\" class=\"submitcomment\"><h3 class=\"formtitle\">Comments</h3>\n";
- echo "<p class=\"top\">Total: $commentNum (<a href=\"#post\" class=\"link\">comment</a>)</p>\n";
- $number = mysql_num_rows($commentquery)+1;
- while($commentrow = mysql_fetch_row($commentquery)){
- $number--;
- $commentbb = BBCode($commentrow[3]);
- $commentDate = formatDate($commentrow[4]);
- echo "<div class=\"commentbody\" id=\"$commentrow[0]\">\n
- <p>$commentbb</p>\n
- <p class=\"postedby\">";
- if($commentrow[2]){
- echo "<b class=\"name\">$commentrow[2]<b class=\"kb\">,</b></b>";
- }
- echo "<b class=\"date\">$commentDate</b> | <b class=\"number\">#$number</b></p>\n
- \n</div>";
- }
- echo "</div>";
- }
Thanks in advance.