Turning user ID into name (seperate tables) in PHP
- by mobile
I am currently trying to display the username of people who i am following, the problem is that during the following process, only the ID of me and the person i'm following is stored.
I've got it to the point where the ID's are displayed but i'd like to show the names hyperlinked. $p_id is the profile ID.
Here's what I've got:
$following = mysql_query("SELECT `follower`, `followed` FROM user_follow WHERE follower=$p_id");
I am following: <?php while($apple = mysql_fetch_array($following)){
echo '<a href="'.$apple['followed'].'">+'.$apple['followed'].'</a> ';
}?>
The usernames are in a different table "users" under the field "username" - I need them to match up with the ID's that are currently displayed, and be displayed.
Any help appreciated,
thanks guys