1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

mysql - check if user belong to multiple groups in where clause

Discussion in 'Community' started by mirceat, Jan 19, 2020.

  1. mirceat

    mirceat Member

    Level: Community
    Hello,

    I need to check if a user belong to multiple groups in Where condition for a dbjoin element using "case when then" or "if else..".

    something like:

    Code (Text):

    select ID from my_table where field IN
    (case '{$my->group}'
    when (101 or  27) and 135 then 82
    when 101  then 71
    when 27 then 62
    ...
    end)
     
    The website use Active Directory to map the users to groups with ID 101 or 27. Users are manually added to group_id = 135 by an administrator.

    Thank you
     

Share This Page