CodeIgniter ActiveRecord join statement dropping '[' from the ON clause
The problem is in the parameter ON
. There does not exist an integrated solution in the framework (not in version 2).
You have 2 options:
Write the query in a complete chain with concatenations using $this->db->query();