I have an issue of getting results from the database. I have a column called "Regions" which as a value contains all the regions user had chosen via newsletter signup form with commas i.e "Middle East, Europe"
I am creating a filter which will need to get all the users list who signup for a particular or multiple regions. Users can select multiple regions. From the frontend am getting all the selected regions in this format "Global,Middle East" which i need to use in my SQL query to find all the users who has the Global and Middle East as a chosen region.
I tried to use FIND_IN_SET but it is not really helping. Tried the below
$trimmedRegions = rtrim($sortType,', ');
$query = "SELECT * FROM health_alerts_subscribers
WHERE FIND_IN_SET(Regions, $trimmedRegions)";
Any ideas how I can achieve the needed result please?