I have created a Shop Search Form for my web site, where users can select multiple district. I want to ask after I receive the multiple selected options for district, how to return the searching result for users' selected options?
e.g. Users can select US and JP, then my result return SHOP in US or JP
search.php
<select name="district" id="district">
<option value='US'>US</option>
<option value='UK'>UK</option>
<option value='JP'>JP</option> ... </select>
result.php
I know to get multiple selected is by using:
foreach ($_GET['district'] as $selectedDistrict)
$district[] = $selectedDistrict;
but how to write the matching query?
such as SELECT * FROM shop WHERE district = '$district'
?