CI 2.1.0 db error but working ok with CI 2.0.2 - 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: CI 2.1.0 db error but working ok with CI 2.0.2 (/showthread.php?tid=48837) |
CI 2.1.0 db error but working ok with CI 2.0.2 - El Forum - 01-30-2012 [eluser]Unknown[/eluser] hi i have this: Code: $q = $this->db in ci 2.0.2 it's working fine Switching the framework to 2.1.0 and this is the result: 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 '`2)` ) AS `scorp_iva4` FROM (`rci_registro_date`, `aaa_iva_oriz`) WHERE `meseann' at line 1 SELECT SUM(`totale`) AS totale, SUM(`iva4`) AS iva4, SUM(`iva10`) AS iva10, SUM(`iva20`) AS iva20, cast( (sum(`rci_registro_date`.`iva4`) / (1.04)) AS DECIMAL(12, `2)` ) AS `scorp_iva4` FROM (`rci_registro_date`, `aaa_iva_oriz`) WHERE `meseanno` = '012012' CI adds the ` even though i've added FALSE as the second parameter in the select UPDATE I've simplified the query trying to understand where the problem is Code: controller In CI 202 both the queries are working IN CI 210 only the first one works, the difference is the order of the select - select_sum so, is this a bug? CI 2.1.0 db error but working ok with CI 2.0.2 - El Forum - 02-09-2012 [eluser]Phil Sturgeon[/eluser] Try this on the 2.1-stable branch and see what happens. There was a bug that basically made sum, max, etc useless. |