The user_id can be found on the replies table but also in the profiles table. The profiles table has the real_name column.
Below I get all the replies for a specific article_id. My question is how do I echo the real_name of the commenters that is saved into the profiles table ?
I am consider the performance of this.
$replies = mysql_query("select * from replies where article_id = '$row[id]' order by timestamp desc");
while($reply = mysql_fetch_assoc($replies)) {
I can echo the comments from the replies table, but how do I echo the real_name of each?
}
select p.real_name, r.* from replies as r join profiles as p on r.profileid = p.profileid where article_id = '$row[id]' order by timestamp descmight have to update theprofileidcolumn names