0
我想從我的數據庫中提取記錄,包括簽入日期,簽出日期和聯繫人ID,但我無法取得成功,請幫我解決,我正在使用Codeigniter。codeigniter mysql query有什麼問題
$this->db->select('*');
$this->db->from('events');
$this->db->where('contact_id',$contact_id);
$this->db->where('check_in_date >=',$chkIn);
$this->db->where('check_out_date <',$chkout);
$data = $this->db->get()->result_array();
MySQL的:
SELECT * FROM (`events`) WHERE `contact_id` = 4 AND `check_in_date` >= '2014-09-14' AND `check_out_date` < '2014-09-25'
向我們展示了更多代碼。我假設你在代碼後面使用'$ this-> db-> get();'。 – machineaddict 2014-09-11 11:09:57
yes我正在使用$ this-> get .... – user3432211 2014-09-11 11:12:50
您可以在'$ data = $ this-> db-> get()之後添加'print_r($ this-> db-> last_query());'' > result_array();'。也許可以在phpMyAdmin中運行該查詢來查看結果。 – machineaddict 2014-09-11 11:21:18