何らかの理由で、データベースのすべてのメンバーをリストに表示して、クリックしたときに各メンバーのプロファイルにアクセスしようとしていますが、データベース内の最後の人のリンクしか取得していません。ヘルプ?
include_once "../../mysql_server/connect_to_mysql.php";
//This code is used to display friends in the box of friends
$sql = mysql_query("SELECT * FROM myMembers");
$numberofRows = mysql_num_rows($sql);
$memberDisplayList = 'There are ' . $numberofRows .' members<br /><br />';
while($row = mysql_fetch_array($sql)) {
$id = $row['id'];
$firstname = $row["firstname"];
$lastname = $row["lastname"];
/////// Mechanism to Display Pic. See if they have uploaded a pic or not
$check_pic = "../../members/$id/image01.jpg";
$default_pic = "../../members/0/image01.jpg";
if (file_exists($check_pic)) {
$user_pic = "<img src=\"$check_pic?$cacheBuster\" width=\"80px\" />";
} else {
$user_pic = "<img src=\"$default_pic\" width=\"80px\" />";
}
$memberDisplayList = '<a href="http://www.pathtosite.com/friends_page.php?id='. $id .'">' . $firstname .' '. $lastname .'</a><br />';
}
// ------- END WHILE LOOP FOR GETTING THE MEMBER DATA ---------