Welcome Guest, Not a member yet? Register   Sign In
join of users and users_groups as 1 row
#1

Hello,
Using CodeIgniter 3.0.3 I make join of users and users_groups tables with command
PHP Code:
    $this->db->join($this->ion_auth_config_tables['users_groups'], $this->ion_auth_config_tables['users_groups'] . '.user_id = ' $this->ion_auth_config_tables['users'] . '.id''left'); 

and I get sql like

Code:
SELECT bp_users.*
FROM `bp_users`
LEFT JOIN `bp_users_groups` ON `bp_users_groups`.`user_id` = `bp_users`.`id`



as any user can be member of several groups in result set for any such user I get several rows.
I would like for any user to get 1 row with subarray of his groups.
Sure, I can make such grouping manually. But can I to make such using CodeIgniter db/sql methods ?

  Thanks!
Reply


Messages In This Thread
join of users and users_groups as 1 row - by mstdmstd - 01-04-2016, 08:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB