![]() |
Pagination with Join queries - 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: Pagination with Join queries (/showthread.php?tid=88547) |
Pagination with Join queries - udaopi - 09-26-2023 Hello, i have problem in pagination. im try to make manual pagination based on documentation, and get some help from ChatGPT, but that AI cannot fix it. i can't get array key when using select() and join() it with another table. this is it, my english not good, hope you all understand what i mean. PHP Code: public function berita() { i try to var_dump() the result $data['konten'], but 'foto_berita' and 'kategori_berita' not exist. look at $query, OrderBy not work too . where the problem? RE: Pagination with Join queries - kenjis - 09-26-2023 Check the SQL statement that was executed from Debug Toolbar. RE: Pagination with Join queries - udaopi - 09-26-2023 (09-26-2023, 07:54 PM)kenjis Wrote: Check the SQL statement that was executed from Debug Toolbar. I checked it, that key is not in the result in database and vars tab, this is screenshoot of executed queries ![]() Not all of the queries worked RE: Pagination with Join queries - udaopi - 09-27-2023 (09-26-2023, 10:50 PM)udaopi Wrote:AAAAAAAAAAAAAAKHH...!!!(09-26-2023, 07:54 PM)kenjis Wrote: Check the SQL statement that was executed from Debug Toolbar. I finally discovered the problem by accident ....!! it turns out that each execution will delete the builder function in the variable. in the code seen I do countAll() before doing findAll(). it turns out countAll() reset all the contents of $query except the model. It seems that we can no longer use the same variable for a second execution without refilling the builder function .... after 4 days, My stress immediately disappeared. hahahaha thank you all... ![]() |