So I want to match countrycodes with regions.
if ($region == 'eu') {
$country = 'nl', 'be'; etc.. etc..
}
Then I want to get all the users WHERE countrycode is one of the above.
$countryGet = $db->prepare("SELECT countrycode FROM `users` WHERE countrycode = :countrycode DESC LIMIT 100");
$countryGet->execute(array(
':countrycode' => $country,
));
Maybe I'm thinking to complicated but I cant figure out a nice way to do this. Thanks in advance.
in_array()andIN()orFIND_IN_SET()depending on how your DB is setup, if it isn't normalized.