這裏是我的笨代碼無效參數
在結構模型
$where = "is_display ='Yes' AND start_date < '{$current_time}' AND end_date >
'{$current_time}' AND status = 'Live' AND id NOT IN (SELECT id FROM (emts_auction)
WHERE is_display = 'Yes' AND quantity =1 AND sold_qty >0
AND last_auc_ending_time < '{$current_time}')";
$this->db->select('*');
$this->db->from('auction');
$this->db->where($where);
$this->db->order_by("id", "desc");
$query = $this->db->get();
$data = $query->result();
$query->free_result();
return $data;
鑑於
<?php foreach($auction_view as $auction)
{
echo $auction->name;
echo $auction->price;
echo $auction->bid_fee;
}
?>
檢查結果查詢,可能是使用var_dump()或print_r() –
'$ auction_view'不是數組所有。 – user2092317
這意味着沒有記錄匹配,結果爲空 –