1283 Posts
Bucklash
6 years ago
Topic

Hi folks

I am trying to work out where the bad grammar is:

START:

SELECT a.name AS text, a.name AS value
FROM #__users AS a
INNER JOIN 
#__user_usergroup_map AS b
ON b.user_id = a.id
WHERE b.group_id = 10


OPTIONS VALUE: a.name

END:

SELECT id AS text, id AS value
FROM #__users 
WHERE name = [parent]


OPTIONS VALUE: id

PARENT: a.name

This seems legit, can't work out why no work. Tried many permutations. Just end up with not a lot.

Any tips greatly appreciated :)

Unable to work out where to debug the query

Get a Book for SEBLOD
4229 Posts
Kadministrator
6 years ago
1
Level 1

second one is faulty, name is string so it should be quoted WHERE name = "[parent]";

Also PARENT: a.name is not correct in this case as you don't have a alias in the second query, so t should be only name.

1283 Posts
Bucklash
6 years ago
0
Level 2

Hi Klas

I have been scratching my head over this for ages.

I applied the quotes and removed the alias-as-prefix to field and I have result.

Huge thanks :D

Get a VIP membership