代碼點火器一組學生的細節前,每個循環檢查,學生通過學生入園人數的基礎得到如何在codeigniter中檢查數組的條件?
我的錄取人數是$ ad_no = $這個 - >輸入 - >後(」 adn_no');: -
陣列(5){[0] =>串(5) 「11784」[1] =>串(5) 「11837」[2] => 串(5)「11775 「[3] =>串(5) 」11937「[4] =>串(5) 」12061「}
我嘗試選擇這些入場號學生,但結果顯示僅第一學生成績 。
我的代碼:
foreach($ad_no as $key => $id) {
$this - > db - > where_in('ad_no', $id);
$query = $this - > db - > get('duration');
$r = $query - > result_array();
$dur = $r[0]['tot_hr'];
$start = explode(':', $dur);
$end = explode(':', $tm);
$total_hours = $start[0] - $end[0];
$total_hours1 = $start[1] - $end[1];
$mins = abs($total_hours1);
$dur = $total_hours.":".$mins;
$durs[$key] =
array(
'ad_no' => $ad_no[$key],
'tot_hr' => $dur
);
}
$reslt = $this - > Daily_temp_model - > duration($durs);
'時間' 是一個表的名稱? – DFriend
何時/何地設置了「$ tm」的值? – DFriend
請爲此通話提供'$ dur'的示例值$ dur = $ r [0] ['tot_hr'];' – DFriend