As a newbie I'm struggling with calling a variable, I have a MySQL SELECT query with a WHERE clause:
WHERE table_name.j_group_id IN ('".$jgroup."')
but it does not return any results. The table_name.j_group_id is 11 and if I print_r the $jgroup array it returns:
Array ( [0] => 1 [1] => 8 [3] => 2 [4] => 11 )
so 11 is within the array, but why does it not work?
If I change the SELECT query to:
WHERE table_name.j_group_id IN (2, 11, 14, 18) it works as expected.
Just as a background, the $jgroup returns the Joomla users Authorised Groups. I have created Groups for each team, the Group ID has been manually added to the users details within the tables, when a team manger logs in, their Groups ID (picked up from with $jgroup) will match their team members (same Groups ID) and they will have access to their content. This is so I can have one editable page, accessible by all managers, but will only display the staff under that manager.
Thanks in advance and I hope it makes sense!