Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 两个Foreach循环_Php_Mysql_Codeigniter - Fatal编程技术网

Php 两个Foreach循环

Php 两个Foreach循环,php,mysql,codeigniter,Php,Mysql,Codeigniter,我的目标是合并两个foreach循环。代码如下: <?php if(isset($query)) { foreach($query as $row){//there should be another foreach loop here with the condition ($query2->row) echo '<a href="'.base_url().'site/timeline/

我的目标是合并两个foreach循环。代码如下:

<?php
        if(isset($query))
        {
            foreach($query as $row){//there should be another foreach loop here with the condition ($query2->row) 
                echo '<a href="'.base_url().'site/timeline/'.$row->projectId.'"><div class="projbox"> ';
                echo '<div id="proj-head">'.$row->Title.'</a></div>';
                date_default_timezone_set('Asia/Manila');
                $now = date('Y-m-d');
                /*if (($now>$row2->pre_proc_conference)&&($now<$row2->post_of_ieab)){
                    echo '<progress value="11" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->post_of_ieab)&&($now<$row2->pre_bid_conference)){
                    echo '<progress value="22" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->pre_bid_conference)&&($now<$row2->elegibility_check)){
                    echo '<progress value="33" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->elegibility_check)&&($now<$row2->sub_bid)){
                    echo '<progress value="44" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->sub_bid)&&($now<$row2->bid_evaluation)){
                    echo '<progress value="55" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->bid_evaluation)&&($now<$row2->post_qualification)){
                    echo '<progress value="66" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->post_qualification)&&($now<$row2->notice_of_award)){
                    echo '<progress value="77" max="100" id="prog-head"></progress><br/>';
                }
                if (($now>$row2->notice_of_award)&&($now<$row2->contract_signing)){
                    echo '<progress value="88" max="100" id="prog-head"></progress><br/>';
                }
                if ($now>$row2->contract_signing){
                    echo '<progress value="100" max="100" id="prog-head"></progress><br/>';
                }*/
                echo 'Date Started: '.$row->datestarted.'
                      <br />Mode of Procurement: '.$row->procurementmode.'<br/>';
                echo '</div></a>';
            }
        }
    ?>


我该怎么做?我从控制器$query和$query2传递了两个查询。$query2中的值将生成进度条的值。$query中的值将是生成其他详细信息的值

我不明白。。。只是重复两个循环,到底是什么问题?你能补充更多细节吗?我看不到第二个循环第二个循环应该与foreach($query as$row)执行相同的时间(在注释@RandykaYudhistira)什么重复爵士@Bartdude?