Welcome Guest, Not a member yet? Register   Sign In
Problems with sqlsrv DB driver and CI 3
#6

For people getting the same errors with subselects in the form() method you can bypass the escaping with parenthesis.

Not working example:

PHP Code:
$this->db->from("(SELECT field, max(field2)
                            FROM table
                            WHERE field3=1
                            GROUP BY field) con"
); 


Working example:

PHP Code:
$this->db->from("(SELECT field, max(field2)
                            FROM table
                            WHERE field3=1
                            GROUP BY (field)) virtualTable"
); 
Reply


Messages In This Thread
RE: Problems with sqlsrv DB driver and CI 3 - by dimas - 06-02-2015, 04:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB