Same results from Database
<p>I need to add "Last member topics" in the members profile, so that it shows the last 5 topics that member wrote.</p>

<p>I used this code:</p>

<pre><code>$last_topic = mysql_query("SELECT * FROM " .prefix. "TOPICS WHERE T_AUTHOR = '".$ProMemberID."' ORDER BY T_DATE DESC LIMIT 5") or die (mysql_error());
 $result = mysql_num_rows($last_topic);
if ($result &gt; 0){
$rslast = mysql_fetch_array($last_topic);
$topic_id = $rslast['TOPIC_ID'];
$topic_subject = $rslast['T_SUBJECT'];
$topic_mes = $rslast['T_MESSAGE'];
$t_ret = $rslast['T_ENUM'];
$i=0;
   while ($i &lt; $result){

echo '&lt;tr&gt;
  &lt;td colSpan="2" align="center" class="userdetails_data" width="100%"&gt;
  &lt;table border="0" width="100%"&gt;
   &lt;tr&gt;
   &lt;td&gt;

  &lt;font style="font-size: 9pt" face="Arial"&gt;&lt;a href="index.php?mode=t&amp;t='.$topic_id.'"&gt;
  '.$topic_subject.'&lt;/a&gt; 
    &lt;/td&gt;
    &lt;td  class="editedby" width="130"&gt;
    &lt;font face="Arial" style="font-size: 9pt"&gt; Edited 
    : 
    '.$t_ret.'&lt;/font&gt;&lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/td&gt;
 &lt;/tr&gt; 
 ';  



    ++$i;

  }

}else {
echo '&lt;tr&gt;&lt;td colSpan="2" align="center" class="userdetails_data" width="100%"&gt;
  &lt;span lang="ar-eg"&gt;
  &lt;font color="#FF0000" style="font-size: 9pt" face="Arial"&gt;This member has no topics yet! &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;';
}
</code></pre>

<p>It works, but showing the same topic in the 5 rows??!!</p>

<p>any solutions?</p>
