Weird error - 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: Weird error (/showthread.php?tid=50469) |
Weird error - El Forum - 03-27-2012 [eluser]alexbet[/eluser] Hi All, This is driving me nuts, and any help is appreciated. Here is my code: Code: $sql = "SELECT SUM(cf_revshareCommissions.commission) AS commission I am getting a result of 1.32 when I run that query on the MySql server directly. With Codeigniter though, I am getting this error: Message: Object of class CI_DB_mysql_result could not be converted to string And the line that I am getting the error on is this one: $row = $this->$query->row(); What could I be doing wrong? I really have no idea why I am getting this error as I have 3 more queries like this with different parameters that don't give me an error. Weird error - El Forum - 03-27-2012 [eluser]alexbet[/eluser] Just in case someone needs to know, the "cf_revshareCommissions.commission" table column is of the type "float". Thanks! Weird error - El Forum - 03-27-2012 [eluser]CodeIgniteMe[/eluser] I believe you are in excess of codes Code: $row = $this->$query->row(); Code: $row = $query->row(); Weird error - El Forum - 03-28-2012 [eluser]alexbet[/eluser] Ahhh, that's what you get when you work when you are tired. Thanks a lot LA. Weird error - El Forum - 03-28-2012 [eluser]CodeIgniteMe[/eluser] No problem, just don't forget to get some rest once in a while. |