[TYPO3] Advanced query not advanced enough - part 2

Pieter pieter.v at gmx.net
Fri May 12 13:03:49 CEST 2006


Hello group,

I use the advanced query to select FE user from certain groups.  The 
query looks like:

SELECT username,usergroup,first_name,last_name,
			FROM fe_users
			WHERE
				(
fe_users.disable != '1'
AND (
    fe_users.usergroup = '1'
    OR fe_users.usergroup LIKE '%1,%' AND fe_users.usergroup LIKE '%%'
    OR fe_users.usergroup LIKE '%,1%' AND fe_users.usergroup LIKE '%%'
    OR fe_users.usergroup LIKE '%,1,%' AND fe_users.usergroup LIKE '%%'
)) AND fe_users.deleted=0
			ORDER BY zip

I came to this query with the help of Joey on this list.  But there is 
still a situation where the query does not generate the correct result. 
  Example:  a user is member of the groups 3,5,10 and you want the have 
the users from group 1 only.  This user with groups 3,5,10 will be in 
the query.  But he is not member of group 1.

I don't see a way to get this right...

Regards,
Pieter



More information about the TYPO3-english mailing list