Welcome Guest, Not a member yet? Register   Sign In
DB prefix is placed in the wrong place when using MySQL function in SELECT clause
#1

[eluser]mattalexx[/eluser]
To recreate, create this table:
Code:
CREATE TABLE IF NOT EXISTS `site_table1` (
foo VARCHAR(255)
)
No need to put anything in because we aren't going to be able to get anything out. Connect to a database and run this code:
Code:
$this->db->dbprefix = 'site_';
$this->db->select('IF(table1.foo, TRUE, FALSE) AS foo_true');
$this->db->from('table1');
$query = $this->db->get();
I get this error:
Code:
A Database Error Occurred
Error Number: 1305
FUNCTION roses-to-you.site_IF does not exist
SELECT site_IF(table1.foo, TRUE, FALSE) AS foo_true FROM (site_table1)


Messages In This Thread
DB prefix is placed in the wrong place when using MySQL function in SELECT clause - by El Forum - 12-12-2008, 12:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB