PHP 多个数组到单个结果值

问题描述 投票:0回答:0

我得到的结果类似于下面的数组格式,它是多个数组。因此,在导出时仅采用数组结果的第一个值。我想显示整个结果数组..但我没有得到..请帮助我获得整个结果数组。

enter image description here

我的代码是:

$select_email_process = "SELECT a_id,Mail_Subject FROM [D2K_Mojo_Montana].[dbo].[Email_Extraction_Dump_V_Tool] where dedupe_flag=3 and Inserted_time >= '".$batch_from."' AND Inserted_time <= '".$batch_to."' ";           
$select_email_process_result = $this->InputDashboard->query($select_email_process);

$table = array(array('label' => __('Mail_Subject')));

for($i=0;$i<count($select_email_process_result);$i++) {
    foreach($select_email_process_result as $row)
    {
        echo "<pre>";print_r($row[$i]);                 
    }
}

在导出过程中,我只得到第一个数组的第一个值。用我在下面写的代码,

$this->PhpExcel->addTableRow(array(trim($row[0]['Mail_Subject'])));

enter image description here

php arrays cakephp
© www.soinside.com 2019 - 2024. All rights reserved.