if ($row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) { $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id']; $forum_rows[$parent_id]['forum_last_post_subject'] = $row['forum_last_post_subject']; $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; $forum_rows[$parent_id]['forum_last_poster_id'] = $last_poster_id; $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; $forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour']; $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id']; } -- Change above to below if ($row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) { $forum_rows[$parent_id]['forum_last_post_id'] = $last_post_id; $forum_rows[$parent_id]['forum_last_post_subject'] = $last_post_subject; $forum_rows[$parent_id]['forum_last_post_time'] = $last_post_time; $forum_rows[$parent_id]['forum_last_poster_id'] = $last_poster_id; $forum_rows[$parent_id]['forum_last_poster_name'] = $last_poster_name; $forum_rows[$parent_id]['forum_last_poster_colour'] = $last_poster_colour; $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; }