Php 编码点火器复制FOREACH

Php 编码点火器复制FOREACH,php,mysql,codeigniter,frameworks,Php,Mysql,Codeigniter,Frameworks,我试图从mysql中获取一些数据,比如论坛名称和评论编号 我的代码是这样的 <?php foreach(fetch('forum_threads', 'limit=5') as $forum_thread) : ?> <?php foreach(fetch('forums', 'limit=5') as $forum) : ?> <?php foreach(fetch('forum_sections', 'limit=5') as $forum_sect

我试图从mysql中获取一些数据,比如论坛名称和评论编号

我的代码是这样的

<?php foreach(fetch('forum_threads', 'limit=5') as $forum_thread) : ?>
  <?php foreach(fetch('forums', 'limit=5') as $forum) : ?>
    <?php foreach(fetch('forum_sections', 'limit=5') as $forum_section) : ?>
      <li>
        <img src="/themes/<?php echo setting('themes.default_theme') ?>/assets/images/ico/neo-white.png">
        <a href="#comments" class="comments anim-01"><span class="anim-01"><?= $forum_thread->forum_posts_number ?></span></a>
        <h3><a href="./forums/<?= $forum->url_name ?>/<?= $forum_thread->id ?>/<?= $forum_thread->url_title ?>"><?= $forum_thread->title ?></a></h3>
        <span class="meta"><a href="./articles/<?= $article->section->url_name ?>"><?= $forum_section->name ?></a> - <abbr class="timeago" title="<?= $forum_thread->created_at ?>"><?= $forum_thread->created_at ?></abbr></span>
      </li>
    <?php endforeach; ?>
  <?php endforeach; ?>
<?php endforeach; ?>
我想做的是:

    HELLO
    HELLO
    HELLO
    HELLO
    HELOO
    HELLO2
    HELLo2
    HELLO2
    HELLO2
    HELLO2
HELLO
HELLO2. 
对不起,我的英语不好,谢谢你的回答!干杯

做:

<?php foreach(fetch('forum_threads', 'limit=5') as $forum_thread) : ?>

然后打印论坛线程名称,然后:

<?php foreach(fetch('forums', 'limit=5') as $forum) : ?>

然后打印论坛URL,然后:

<?php foreach(fetch('forum_sections', 'limit=5') as $forum_section) : ?>


然后打印您的论坛分区名称。最后关闭所有foreach。

无法回答,您必须给出您正在执行的代码片段
echo$myforumthreadname
或类似的内容。我尝试过这样做:但同样的问题,问题不在您的循环中,而是在之后。但是我们需要看到更多的代码来回答…谢谢你的回答。脚本后的代码: