Hi,
I try to display the list of the super-users in dropdown.
A read_data with in first group and the user model linked by foreign key user_id.
In group conditions
group.group_id/=:8
Return an array with key/value
But i don't no what, in debug no user appears.
[read_admins] => Array
(
[log] => Array
(
[0] => SELECT `user`.`id` AS `user.id`, `user`.`name` AS `user.name` FROM `xxx_user_usergroup_map` AS `group` LEFT JOIN `xxx_users` AS `user` ON `group`.`user_id` = `user`.`id` WHERE `group`.`group_id` = '8' LIMIT 100;
)
[var] => Array
(
)
)
In phpmyadmin the query shows exactly wath i want
user.id and user.name
what the trouble?
thanks
I try to display the list of the super-users in dropdown.
A read_data with in first group and the user model linked by foreign key user_id.
In group conditions
group.group_id/=:8
Return an array with key/value
But i don't no what, in debug no user appears.
[read_admins] => Array
(
[log] => Array
(
[0] => SELECT `user`.`id` AS `user.id`, `user`.`name` AS `user.name` FROM `xxx_user_usergroup_map` AS `group` LEFT JOIN `xxx_users` AS `user` ON `group`.`user_id` = `user`.`id` WHERE `group`.`group_id` = '8' LIMIT 100;
)
[var] => Array
(
)
)
In phpmyadmin the query shows exactly wath i want
user.id and user.name
what the trouble?
thanks
Second table should be user_usergroup_map
Where condition should be
Where condition should be
group.group_id:8And set the relationship manually don't rely on the foreign key - because the Joomla table doesn't have a foreign key properly set up. So
group.user_id:user.idAnd what have you got in the fields to retrieve?
Hello,
Please read better
...FROM `xxx_user_usergroup_map` AS `group`
SELECT `user`.`id` AS `user.id`, `user`.`name` AS `user.name`
I got
user.id and user.name
The query works well in phpmyadmin !
Thanks
Please read better
...FROM `xxx_user_usergroup_map` AS `group`
group.group_id:8shows an error 1164
group.group_id:user.8with
SELECT `user`.`id` AS `user.id`, `user`.`name` AS `user.name`
I got
user.id and user.name
The query works well in phpmyadmin !
Thanks
You read better buddy. If you read what you originally wrote, you'll see that you stated you were using
I just did what I told you to do and it worked straight away.
The other thing you should do is put your USER model first and your GROUP model second.
group:group_id/=:8IN GROUP CONDITIONS. Which is the wrong syntax and the wrong place to put it.
I just did what I told you to do and it worked straight away.
[read_data3] => Array
(
[log] => Array
(
[0] => SELECT `user`.`id` AS `user.id`, `user`.`name` AS `user.name` FROM `#_users` AS `user` LEFT JOIN `#_user_usergroup_map` AS `group` ON `group`.`user_id` = `user`.`id` WHERE `group`.`group_id` = '8' LIMIT 100;
)
[var] => Array
(
[558] => Kamron Brooks
[561] => support@j2store.org
)
The other thing you should do is put your USER model first and your GROUP model second.
Sorry this isn't in group conditions but in where conditions of the group model
You can see the query in debug
You can see the query in debug
Put user model first, group model last
This topic is locked and no more replies can be posted.
