I'm trying to make a multiple conditional join using mysql function to make it, but codeigniter place function between "`" and fail the request.
$this->db
->join(
'contribution_contributions t2',
$this->db->dbprefix($this->_table).'.id = t2.contact_id AND `t2`.`created` >= NOW() - INTERVAL 5 DAY AND `t2`.`created` < (NOW() +
INTERVAL 5 DAY',
'inner'
);
The query
INNER JOIN `default_contribution_contributions` `t2` ON `default_contribution_contacts`.`id` = `t2`.`contact_id` AND `NOW`() - `INTERVAL 5` `DAY` AND `NOW`() + `INTERVAL 5` `DAY)`
The string t2
.created
disappeared and both condition are placed between "`"
`NOW`() - `INTERVAL 5` `DAY` AND `NOW`() + `INTERVAL 5` `DAY)`