【发布时间】:2015-01-19 01:58:24
【问题描述】:
我有一个数组$dtl:
Array
(
[MODULE_NAME] => Array
(
[0] => Daily_Recurring_Grabber
[1] => Daily_Recurring_Grabber
)
[START_EXECUTION] => Array
(
[0] => 19-SEP-14
[1] => 21-SEP-14
)
[FINISHED_EXECUTION] => Array
(
[0] => 19-SEP-14
[1] => 21-SEP-14
)
[NUM_OF_POPULATION] => Array
(
[0] => 6630
[1] => 6169
)
[SUM_AMOUNT] => Array
(
[0] => 397922098.33
[1] => 360955418.47
)
)
我只想显示 SUM_AMOUNT 的值。所以我像这样创建我的视图:
if(isset($dtl)){
foreach($dtl as $row){
?>
<tr>
<td><?php echo $row['sum_amount']; ?></td>
</tr>
但我遇到了一个错误:
Severity: Notice
Message: Undefined index: SUM_AMOUNT
Filename: pages/v_soaotc_monthly.php
这是我的模型
$this->pblmig_db = $this->load->database('collprod', true);
$sql="select * from inh_soa_otc_control
where module_name like 'Monthly_Accumulator%'
and finished_execution is not null";
$stmt = oci_parse($this->pblmig_db->conn_id, $sql);
oci_execute($stmt);
$row = oci_fetch_all($stmt, $result);
oci_free_statement($stmt);
oci_close($this->pblmig_db->conn_id);
return $result;
我是否遗漏了代码中的某些内容?感谢您的帮助
【问题讨论】:
标签: php arrays oracle codeigniter foreach