我有 3 张桌子:
tbl_events --> 主键 = event_id
tbl_event_bids --> (event_id 里面没有主键)
tbl_users --> 主键 = u_id
我想获得这些领域:
tbl_events --> added_date
tbl_events --> bid_end_date
tbl_events --> event_date
tbl_event_bids --> bid_amount
tbl_users --> u_fname
tbl_users --> u_lname
没有任何错误,但数组为空。这段代码有错误吗?请帮忙...
public function get_confirmed_events($loged_user_id){
$this->db->select(' tbl_events.event_name,
tbl_events.added_date,
tbl_events.bid_end_date,
tbl_events.event_date,
tbl_event_bids.bid_amount,
tbl_users.u_fname,
tbl_users.u_lname');
$this->db->where('tbl_events.u_id', $loged_user_id);
$this->db->where('tbl_events.closed_bid', 'N');
$this->db->where('tbl_event_bids.bid_statues', 'W');
$this->db->join('tbl_event_bids', 'tbl_events.event_id = tbl_event_bids.event_id');
$this->db->join('tbl_users', 'tbl_events.u_id = tbl_users.u_id');
$data = $this->db->get('tbl_events');
$confirmed_result = $data->result();
return $confirmed_result;
}