shorty3 Posted July 29, 2010 Share Posted July 29, 2010 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 https://forums.phpfreaks.com/topic/209264-friend-image-kinda-linking-database/ Share on other sites More sharing options...
shorty3 Posted July 29, 2010 Author Share Posted July 29, 2010 bump Link to comment https://forums.phpfreaks.com/topic/209264-friend-image-kinda-linking-database/#findComment-1092764 Share on other sites More sharing options...
shorty3 Posted July 29, 2010 Author Share Posted July 29, 2010 bump Link to comment https://forums.phpfreaks.com/topic/209264-friend-image-kinda-linking-database/#findComment-1092788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.