i have a blog and i have a function to comment in my posts. now when i tried to reply of a comment, then my comment gone at the bottom of the comment. how to make it right after the comment on which i replied.
my db is like this:
where bid means the blogid, wid means the blog writer id, uid goes with the userid who comment reply is the parameter to collect on which the reply comment, comment is the comment, time is the time of the comment.
my php code is:
now can anyone please show me what to do?
my db is like this:
Code:
CREATE TABLE `comment` ( `id` int(11) NOT NULL auto_increment, `bid` int(11) NOT NULL, `wid` int(11) NOT NULL, `uid` int(11) NOT NULL, `reply` int(11) NOT NULL, `comment` text NOT NULL, `time` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
my php code is:
PHP Code:
$qints = @mysql_query("select * from `comment` where bid = '$id'");
while ($commenting = mysql_fetch_array($qints)) {
$us = @mysql_fetch_array(mysql_query("select * from `user` where id='$commenting[3]'"));
$poster = htmlspecialchars_decode($us[4]);
$time = ts($commenting[6]);
echo "<ol class='commentlist'>";
echo "<li class='comment'>";
echo "<div id='comment'>";
echo "<div class='comm-top'>";//1
echo "<div class='comment-author vcard sleft'>";
echo "<img alt='$poster' src='$us[11]' class='avatar' height='40' width='40' />";
echo "<cite class='fn'><a rel='nofollow' style='color: #339966;' href='profile.php?id=$us[0]'>$poster</a></cite> <span class='says'>$sayslang</span>";
echo "</div>";
echo "<div class='comment-meta sright'>";
echo "<a href='#'>$time</a>";
echo "</div>";
echo "</div>";//1.
echo "<div class='comment-body'>";
echo "<p>".htmlspecialchars_decode($commenting[5])."</p>";
echo "<div class='reply'>";
echo "<a class='comment-reply-link' href='#rf=$commenting[0]'>$replylang</a>";
echo "</div>";
echo "</div>";
echo "<div class='comment-body-line'></div>";
echo "</div>";
echo "</li>";
echo "</ol>";
}
Comment