0
votes

I have three where conditions in my query and I want all them to merge in array only with codeigniter active record.

$this->db->where(array('id'=>5,'name'=>$name));  // I want to insert create_date >= DATE_SUB(NOW(), INTERVAL 1 MONTH) here in this where array

Please dont suggest any solution like to add this condition separately.

Thanks !

1
Did you try with false parameter like $this->db->where(array(...), false); ? - Bora
I am not sure how can i add create_date >= DATE_SUB(NOW(), INTERVAL 1 MONTH) within this array like 'name'=>$name can u please suggest? - Lerry

1 Answers

1
votes

try this

$this->db->where(array('id'=>5,'name'=>$name))
$this->db->where('create_date >=', "DATE_SUB(NOW(), INTERVAL 1 MONTH)")