![]() |
Parenthesis in 'FROM' clause causing mysql error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Parenthesis in 'FROM' clause causing mysql error (/showthread.php?tid=88490) |
Parenthesis in 'FROM' clause causing mysql error - xanabobana - 09-15-2023 Hi- We recently upgraded our servers to mySQL 8.0 and started getting an error with a query that had previously been working. This is the php code causing the error: PHP Code: $this->db->select('tblIndicators.*,GROUP_CONCAT(tblVersionInfo.fkDatasetID) as fldDatasetIDs'); The error returned is: Code: Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') Code: SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); But basically, I need to figure out how to stop CI from adding a parenthesis around the FROM clause to get it to run. The only thing I could figure out was maybe getting the compiled select statement and just removing them from the string, and then executing the string, but that seems like a pretty terrible solution. This is happening on a bunch of queries, and they are from code previously written by a coworker no longer working with us, so any help on getting this fixed without having to rewrite a whole bunch of complex queries is appreciated! RE: Parenthesis in 'FROM' clause causing mysql error - xanabobana - 09-22-2023 A colleague suggested using a view for the subquery and that worked! |