I'm trying to figure out how to find one of the elements in an array in a field that is an array. Specifically, I want to be able to define several group numbers and have it look for any one of those numbers in the "additionalGroups" field in the smf_member table. I have
$groups_array = array(1,2,3);
What is the "WHERE" syntax to find whether any one of those numbers is included in any of the numbers in the addtionalGroups field?
FIND_IN_SET
FIND_IN_SET(". $group . ", mem.additionalGroups))
OR
IN
ID_POST_GROUP IN ($groups)
(where groups is 1,2,3,4,5)
To check all the groups smf uses a where clause like
WHERE (mem.ID_GROUP IN (" . implode(', ', $groups) . ") OR mem.ID_POST_GROUP IN (" . implode(', ', $groups) . ") OR FIND_IN_SET(" . implode(", mem.additionalGroups) OR FIND_IN_SET(", $groups) . ", mem.additionalGroups))
Thanks!