CodeIgniter Forums

Full Version: Active Record 'where'-issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I just upgraded a larger website from CI2 to CI3.0.3. and runned into active record problems:

The following statement runned fine in CI2.2 but not in CI3.0.3:

$this->db->where(array('id BETWEEN 0 AND ' => '171'));
$r = $this->db->get('gemeinde')->query_result();

Error log:

Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BETWEEN0 AND '171'' at line 3
SELECT * FROM `gemeinde` WHERE `id` BETWEEN0 AND '171'

It seems that in CI3 the space between 'BETWEEN' and 0 is removed? What do I miss here?

Thanks Martin