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