title: How to looping the variable on php
body: <p>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.</p>
  
  <pre><code>&lt;?php
  include 'connection.php'; 
          echo '&lt;table border="1" bgcolor="#FBFBEF" width="100%" height="20"&gt;&lt;tr&gt;';
          echo '&lt;td width="80%" height="20"&gt;&lt;strong&gt;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'&lt;/strong&gt;&lt;/td&gt;&lt;td  align="center" valign="top"&gt;&lt;strong&gt;&lt;?php ';
        $query2="select * from comment where topic_id=".$_REQUEST['topic'];
        $result2=mysql_query($query2);
        $row2=mysql_fetch_array($result2);
        echo $row2['post_date'];
        echo '&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;';
      echo '&lt;table border="1" bgcolor="#FBFBEF" width="100%" height="20"&gt;&lt;tr&gt;&lt;td align="center" valign="top" height="20"&gt;&lt;strong&gt; Post By :&lt;strong&gt;&lt;/td&gt;&lt;td width="85%" &gt;&lt;strong&gt;';
          echo $row['title'];
          echo'&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
      echo '&lt;tr&gt;&lt;td align="center" valign="top"&gt;&lt;strong&gt;';
              $query3="select * from user_login where email='".$row2['post_by_user']."'";
              $result3=mysql_query($query3);
              $row3=mysql_fetch_array($result3);
              echo '&lt;br&gt;'.$row3['first_name'].' '.$row3['last_name'];
  
          echo '&lt;/strong&gt;&lt;/td&gt;&lt;td align="left" valign="top" height=200&gt;';
        //displaying list comment
      echo '&lt;p&gt;'.$row2['description'].'&lt;/p&gt;&lt;hr&gt;';
       }while($row=mysql_fetch_array($result2));
        }
        ?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>why is the looping failed ?</p>