I have a comment table where all the comment are stored and i want to show the last 20 comments
$query="SELECT * FROM comment WHERE answerid=$answerid ORDER BY time DESC LIMIT 20";
It gives me last 20 but from top to down,But i want to get them in down to top .Means last comment(by time) should be shown at last
i used
$result = mysql_query($query);
$newresult = array_reverse($result);
while( $row = mysql_fetch_array($newresult) ) {
//my code
echo $row['content'];
}
but this doesn’t work?
Try: