DB prefix is placed in the wrong place when using MySQL function in SELECT clause - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: DB prefix is placed in the wrong place when using MySQL function in SELECT clause (/showthread.php?tid=13947) |
DB prefix is placed in the wrong place when using MySQL function in SELECT clause - El Forum - 12-12-2008 [eluser]mattalexx[/eluser] To recreate, create this table: Code: CREATE TABLE IF NOT EXISTS `site_table1` ( Code: $this->db->dbprefix = 'site_'; Code: A Database Error Occurred DB prefix is placed in the wrong place when using MySQL function in SELECT clause - El Forum - 12-12-2008 [eluser]mattalexx[/eluser] Here's my hack (I'll extend the db class for this later, but right now, I'm hacking the core). Before: Code: // ci/database/DB_driver.php, line 1240: Code: if ($this->dbprefix != '' && preg_match('/^[a-z!]+\(/i', $parts[0]) !== 1) EDIT: I put a shriek in the regex so that "!ISNULL(..." is supported as well as "ISNULL(...". |