Jump to content

friend Image - Kinda Linking Database


shorty3

Recommended Posts

Right i want to have friends displayed on peoples profiles but i can only ave there name and not the avater displayed here is the code ive got which doesnt work

 

        <? 
$picture = mysql_query("SELECT * FROM users WHERE username = '$dip->person'");
$pc = mysql_fetch_object($picture);
$query_friends=mysql_query("SELECT * FROM friends WHERE username='$viewuser' AND type='Friend'");

$rows=mysql_num_rows($query_friends);
if ($rows == "0"){ echo "<center>No friends</center>"; }
$friend = 0;
while($dip=mysql_fetch_object($query_friends)){

echo "  <img src='$pc->image' width='50' height='50' border='1'><br><a href='profile.php?viewuser=$dip->person'>$dip->person</a>,"; 
$friend++; 
echo ($friend % 3 == 0)? "<br>" : ""; }
?>

 

 

The friends are from the friends database and the avater is from the users database how can i link them so the name and the avater show ive tried this but only the names are displayed and the avaters dont show

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.