[TYPO3] Advanced query not advanced enough?

JoH info at cybercraft.de
Thu Apr 20 01:12:09 CEST 2006


> The DB check has an Advanced query but I somehow managed to have a need 
> for an even more advanced one ;-)
>
> I want to make a query with the members of certain FE usergroups: all 
> users of group 1 for example.
>
> There are more then 10 FE usergroups on the website.  They have uid  1 up 
> to 14.  I have a user who is member of groups "3,4,11".
>
> The Avanced DB query can not generate a list with only the members of 
> group 1:
> - 'equals' only works if the users is member of exactly 1 group.
> - 'contains' also includes the users of group 10 or 11.
>
> The other options are no solution either.
>
> What it needs is a query looking like this:
> fe_users.usergroup = '$item' OR fe_users.usergroup LIKE '$item,%' OR 
> fe_users.usergroup LIKE '%,$item' OR fe_users.usergroup LIKE '%,$item,%'
>
> where $item is the value entered.
>
> Is my thinking correct?  And is there a way to overcome this problem? How 
> do I extract a list of members of a FE Group?

You already sent me this request by mail, but I wasn't able to answer since 
your adress was not accepted.
Anyway, here's the solution: You don't need additional functionality but you 
should use the existing in a more "advanced" way.

You can add as many parts to the query as you like.
So you can easily click something together that is exactly looking like your 
query:

1. usergroup | equals | 1
klick the plus symbol, change the selectbox to "or" and modify the next part 
to be
2. usergroup | contains | 1,
klick the plus symbol, change the selectbox to "or" and modify the next part 
to be
3. usergroup | contains | ,1,
klick the plus symbol, change the selectbox to "or" and modify the next part 
to be
4. usergroup | contains | ,1

This will result in the query you asked for.

HTH

Joey 





More information about the TYPO3-english mailing list