出于某种原因,我试图在列表中显示数据库中的所有成员,以便在单击它们时访问他们的每个配置文件,但我只获取数据库中最后一个人的链接,任何帮助?
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 ---------