dimoss
Well-Known Member
Hi
I have a dbjoin element with the folowing join query:
INNER JOIN entr_user_usergroup_map ON {thistable}.id = entr_user_usergroup_map.user_id
WHERE entr_user_usergroup_map.group_id = 2
What is I want to achive is to select only the users who belong to the registered group with group_id = 2
The query works ok in phpmyadmin and it brings also the registered users when I make it filtered.
However when I click to add a new record on this form, I get the following:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN entr_user_usergroup_map ON entr_users.id = entr_user_usergroup_map.us' at line 3 SQL=SELECT DISTINCT(`entr_users`.`username`) AS value, `username` AS text FROM `entr_users` AS `entr_users` WHERE INNER JOIN entr_user_usergroup_map ON entr_users.id = entr_user_usergroup_map.user_id WHERE entr_user_usergroup_map.group_id = 2 ORDER BY text ASC
What is the problem?
Thanks!
I have a dbjoin element with the folowing join query:
INNER JOIN entr_user_usergroup_map ON {thistable}.id = entr_user_usergroup_map.user_id
WHERE entr_user_usergroup_map.group_id = 2
What is I want to achive is to select only the users who belong to the registered group with group_id = 2
The query works ok in phpmyadmin and it brings also the registered users when I make it filtered.
However when I click to add a new record on this form, I get the following:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN entr_user_usergroup_map ON entr_users.id = entr_user_usergroup_map.us' at line 3 SQL=SELECT DISTINCT(`entr_users`.`username`) AS value, `username` AS text FROM `entr_users` AS `entr_users` WHERE INNER JOIN entr_user_usergroup_map ON entr_users.id = entr_user_usergroup_map.user_id WHERE entr_user_usergroup_map.group_id = 2 ORDER BY text ASC
What is the problem?
Thanks!