How to display a friend list in php?

Nycholas C

New member
///// I have two tables.Mymebers and eBuddies. ebuddies haves id, buddy_id and status rows. myMembers has all my members info- Name, email, ect...

this script shows the buudy id of the session user. How can i make it show the my members info like name.

eBuddies 'buddy_id' = myMembers 'id'

eBuddies 'id' = myMembers 'id'////////////////////////



<?php

session_start();

include_once "scripts/connect_to_mysql.php";

$user = $_SESSION["id"];


$friends="SELECT * FROM eBuddies WHERE id='$user' AND status='b'";
$query=mysql_query($friends);

while ($row = mysql_fetch_assoc($query)) {
echo = $friends=$row['buddy_id'];
}




$friends2="SELECT * FROM eBuddies WHERE buddy_id='$user' AND status='b'";
$query=mysql_query($friends2);

while ($row = mysql_fetch_assoc($query)) {<br />
echo $friends2=$row['id'];<br />
}

$check_pic = "members/$id/image01.jpg";
$default_pic = "members/0/image01.jpg";
if (file_exists($check_pic)) {
$user_pic = "<img src=\"$check_pic\" width=\"120\" height=\"auto\" max-height=\"300px\">"; // forces picture to be 180px wide and no more
} else {
$user_pic = "<img src=\"$default_pic\" width=\"180px\" />"; // forces default picture to be 100px wide and no more

}
$outputList .= '
 
Back
Top