[SOLVED] Query builder gone wrong? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: [SOLVED] Query builder gone wrong? (/showthread.php?tid=87176) |
[SOLVED] Query builder gone wrong? - superior - 03-22-2023 Hi, For a client i'm building an application that will show him some data, not important how or what that is. This query fails: PHP Code: $builder = $orderModel But this query works PHP Code: $builder = db_connect()->query(" The mismatch data on failed query is Is there something wrong with my query in the build i'm unable to see what is going on.. The 'total_paid' should be "107.69" i've got zero clues what i'm doing wrong. RE: Query builder gone wrong? - InsiteFX - 03-22-2023 Did you try using the getLastQuery? PHP Code: echo $db->getLastQuery(); RE: Query builder gone wrong? - superior - 03-23-2023 Hi @InsiteFX Thank you for the reply, the first query used to be in my Controller (for testing etc.) after moving it to the Model it seems to be working. My guess is it has run multiple times because it generates DataTables so this was a simple mistake from my side, the data output is correct now! I'll mark this topic as solved! RE: [SOLVED] Query builder gone wrong? - InsiteFX - 03-23-2023 Ok, Thanks for the heads up. |