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:
1) aaa commented on 1st blog post(2)
2) ddd commented on 2nd blog post(10)
3) ccc commented on 3rd blog post(1)
my codes are this:
<?
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 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:
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 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