Jump to content

Need help doing a topic preview with while


Gazan

Recommended Posts

Alright  :D

 

I'm working on creating my own php forum now, but i got stuck during the show topic page. I'd like to do a while to show the replies, and in the while i would like to show the users profile avatars.

 

  $query = mysql_query("SELECT * FROM replies WHERE topic_id = '".$topicid."'");

  while($row = mysql_fetch_assoc($query))

  {

  $replierid = $row['replier_id'];

  $reply = $row['message'];

  $replierdate = $row['replier_date'];

  echo "

  <table align=center width=420 cellspacing=0 cellpadding=0>

  <tr>

  <td align=left>";

                      $query = mysql_query("SELECT * FROM users WHERE id = '".$replierid"'");

  $row = mysql_fetch_assoc($query);

  $repliername = $row['username'];

  echo $repliername;

  echo "<br>";

 

Can you tell me why that doesn't work ?

What im trying to do is to select the user information, in the while.

Is that just not possible?

- if so, how do i do it then?

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.