我正在制作像Facebook一样的Feed功能,但出于某种原因,它会一起循环。 它不是显示最新到最旧的更新,而是在每个组的行中显示它们。
而不是循环为最旧,最新,最新,更新,它将它们作为一个包在自己的组中循环。
我的代码
} else if ($feed_viewing=='clan_updates') {
$select_clan_membership = $db->query("SELECT * FROM spud_groups_members WHERE member_name='$mybb_username'");
while($select_clan_membership_array = $db->fetch_array($select_clan_membership)) {
$gurl = $select_clan_membership_array['gurl'];
$select_posts_from_groups_query = $db->query("SELECT * FROM spud_groups_posts WHERE group_url='$gurl' ORDER BY post_id DESC");
while($select_posts_from_groups_array = $db->fetch_array($select_posts_from_groups_query)) {
$group_url_id = $select_posts_from_groups_array['group_url'];
$post_body = $select_posts_from_groups_array['post_body'];
$select_group_data_from_posts_query = $db->query("SELECT * FROM spud_groups WHERE gid='$group_url_id'");
$select_group_data_from_posts_array = $db->fetch_array($select_group_data_from_posts_query);
$group_name_data = $select_group_data_from_posts_array['group_name'];
#$group_name_data = false;
echo "<div class='mx'>
<p> <h2> $group_name_data </h2></p>
$post_body</div>
<br>
";
}
}