![]() |
orderBy did not work when using chunk - 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: orderBy did not work when using chunk (/showthread.php?tid=91725) |
orderBy did not work when using chunk - warcooft - 09-26-2024 I have a query using a model to perform chunk operations on data taken from the "konfirmasi_pembayaran" table and perform a join with the "users" table to get the "nama" column. This query also uses orderBy to sort the data by the "user_nama" column (which is an alias for users.nama), but the expected sorting doesn't work well when using the chunk method. Any help would be greatly appreciated. The query as follow: PHP Code: $order = 0; Code: "title": "CodeIgniter\\Database\\Exceptions\\DatabaseException", without chunk the query is work fine: PHP Code: $dd = $model->select('konfirmasi_pembayaran.*, users.nama as user_nama') RE: orderBy did not work when using chunk - JustJohnQ - 09-26-2024 Try the following code for the orderBy statement: PHP Code: ->orderBy('users.nama', 'asc') RE: orderBy did not work when using chunk - warcooft - 09-26-2024 @JustJohnQ Thankyou for your response, I previously used a method like that but it didn't work, then I asked GPT and recommended using an alias but the result was the same, it didn't work. |