hi i am with another problem. :/
in my blog, i wanted to show the last comment of the blog posts on recent coment section.
ex:
my codes are this:
my codes shows all the comments which are the last 10. but i need the last comments of all the blog posts, not the comments of the same post.
my codes shows like this:
comment from the same should not come more than once. but i can't make it. please help. i actually feeling shy to seeking help from u guys, coz everytime when i fail to do something i get help from u guys specially something_else. please help to make it work
in my blog, i wanted to show the last comment of the blog posts on recent coment section.
ex:
PHP Code:
1) aaa commented on 1st blog post(2)
2) ddd commented on 2nd blog post(10)
3) ccc commented on 3rd blog post(1)
PHP Code:
<?
echo "<div class='sidebar-entry'>";
$result = mysql_query("SELECT * FROM comment order by id desc LIMIT 0,10");
while ($row = mysql_fetch_array($result)) {
$tot = @mysql_num_rows(mysql_query("SELECT bid FROM comment WHERE bid='$row[1]'"));
$writer = @mysql_fetch_array(mysql_query("SELECT * FROM user WHERE id='$row[3]'"));
$blogname = @mysql_fetch_array(mysql_query("SELECT * FROM blog WHERE id='$row[1]'"));
$blogn = htmlspecialchars_decode($blogname[2]);
$writer = htmlspecialchars_decode($writer[4]);
echo "<img class='arrow' src='images/dot_red.gif' alt='ยป'/> $writer commented on <a class='side' href='blogc.php?id=$row[1]'>$blogn</a>(".$tot.")<br />";
}
echo "<div class='block'></div>";
echo "</div>";
?>
my codes shows like this:
PHP Code:
1) aaa commented on 1st blog(2)
2) bbb commented on 1st blog(2)
3) ddd commented on 2nd blog(10)
4) ccc commented on 3rd blog(1)
5) nnn commented on 2nd blog(10)
Comment