![]() |
I have joined three tables but my pagination only gives me my post table fields and not fields from the other 2 tables. I can see in the debugging bar that the proper sql is being executed. I can run that sql directly in mysql and the expected results are returned (eg fields from all three tables). Why are the other fields from the other tables now available please?
Here is my controller; Code: function index(){ This is the sql that is produced; Code: SELECT `post`.`post_id`, `post`.`post_category_id`, `post`.`post_title`, `post`.`post_slug`, `post`.`post_body`, `post`.`post_is_published`, `post`.`post_updated_at`, `post`.`post_created_at`, `post`.`post_user_id`, `post`.`post_image`, `user`.`name`, `user`.`email`, `category`.`category_id`, `category`.`category_user_id`, `category`.`category_name`, `category`.`category_is_published`, `category`.`category_created_at`, `category`.`category_updated_at` FROM `post` JOIN `category` ON `category`.`category_id` = `post`.`post_category_id` JOIN `user` ON `user`.`id` = `post`.`post_user_id` WHERE `post`.`post_is_published` = 1 AND `category`.`category_is_published` = 1 ORDER BY `post`.`post_updated_at` DESC This is the view output; Code: [post_id] => 264 |
Messages In This Thread |
CI4 with join and pagination - by spreaderman - 08-20-2021, 06:43 PM
RE: CI4 with join and pagination - by InsiteFX - 08-21-2021, 12:52 AM
RE: CI4 with join and pagination - by spreaderman - 08-21-2021, 01:20 AM
RE: CI4 with join and pagination - by paliz - 08-21-2021, 01:23 PM
RE: CI4 with join and pagination - by spreaderman - 08-21-2021, 06:57 PM
|