There's a lot of missing information, and I don't know what you're doing with the fetch() function, but I would have to assume it should be in the controller instead of the view. With this in mind, I've put together an example of what I think you're trying to do:
PHP Code:
<h1>Forum</h1>
<?php
foreach ($forum_threads as $forum_thread) :
$forums = $forum_thread->forums;
?>
<h2><?php echo $forum_thread->title; ?></h2>
<?php
foreach ($forums as $forum) :
$forum_sections = $forum->sections;
?>
<h3><?php echo $forum->title; ?></h3>
<?php foreach ($forum_sections as $forum_section) : ?>
<h4><?php echo $forum_section->title; ?></h4>
<p>More stuff from $forum_section goes here.</p>
<?php endforeach; ?>
<p>A footer for the current $forum could go here.</p>
<?php endforeach; ?>
<p>A footer for the current $forum_thread could go here.</p>
<?php
endforeach;
Basically, the issue is that you appear to be echoing content in your inner-most loop which belongs at a higher level. Of course, there's not enough information in your question to determine if any of the code I've included is remotely correct, but I'm hoping that it clarifies the situation.