this is my view topic page:
<?php include("head.php");
include("config.php");
$topicid = $_GET['topicid'];
$query = "SELECT title,forum_id FROM topics WHERE topic_id = '".$topicid."'";
$result = mysql_query($query);
list($title,$forumid) = mysql_fetch_row($result);
echo '<font size="+3">'.$title.'</font><br /><font size="+1">';
$query = "SELECT title FROM forums WHERE forum_id = '".$forumid."'";
$result = mysql_query($query);
list($title) = mysql_fetch_row($result);
echo '<a href="viewforum.php?forumid='.$forumid.'">'.$title.'</a></font><br />';
$query = "SELECT user_id,content FROM posts WHERE topic_id = '".$topicid."'";
$result = mysql_query($query);
while(list($userid,$content) = mysql_fetch_row($result)){
echo '<table width="400"><tr><td colspan="3">'.$username.'</td></tr><tr>
<td><img src="'.$avvy.'" align="top"></td><td>'.$content.'<hr />'.$sig.'</td></tr></table>';
}
if(empty($id)){
echo 'You have to log in to reply';
}else{
?>
<center>
<iframe src="forumreply.php?topicid=<? echo $topicid; ?>&userid=<? echo $id; ?>" width="400" height="200">
ERROR(NOT REPLY FAIL)
</iframe>
</center>
<center>
<?
}
include("foot.php");
?>
It shows everything fine. But i need it to display the username and avatar and the signature with this code:
$query = "SELECT username,signature,avatar FROM users WHERE id = '".$userid."'";
$result = mysql_query($query);
list($username,$sig,$avvy) = mysql_fetch_row($result);
And then display it, but for some reason when i use it only one reply is shown. All the rows are not shown! The others are all not there!
The same happens with my view forum page.