i have problem on my comment list in my forum website php please help i trying to looping all the user comment, but it just appear 1 or fail looping that show all same comment in many number.
<?php
include 'connection.php';
echo '<table border="1" bgcolor="#FBFBEF" width="100%" height="20"><tr>';
echo '<td width="80%" height="20"><strong>Thread :';
$query="select title from topic where topic_id=".$_REQUEST['topic'];
$result=mysql_query($query);
$row=mysql_fetch_array($result);
echo $row['title'];
if($row){
do{
echo'</strong></td><td align="center" valign="top"><strong><?php ';
$query2="select * from comment where topic_id=".$_REQUEST['topic'];
$result2=mysql_query($query2);
$row2=mysql_fetch_array($result2);
echo $row2['post_date'];
echo '</strong></td></tr></table>';
echo '<table border="1" bgcolor="#FBFBEF" width="100%" height="20"><tr><td align="center" valign="top" height="20"><strong> Post By :<strong></td><td width="85%" ><strong>';
echo $row['title'];
echo'</strong></td></tr>';
echo '<tr><td align="center" valign="top"><strong>';
$query3="select * from user_login where email='".$row2['post_by_user']."'";
$result3=mysql_query($query3);
$row3=mysql_fetch_array($result3);
echo '<br>'.$row3['first_name'].' '.$row3['last_name'];
echo '</strong></td><td align="left" valign="top" height=200>';
//displaying list comment
echo '<p>'.$row2['description'].'</p><hr>';
}while($row=mysql_fetch_array($result2));
}
?>
</td>
</tr>
why is the looping failed ?