I have a search with a select that can select more than one option, but I do not know how to do it so they search for all the selected options.
Currently it does the search, it inserts the values in the url (I'm using GET
), but it can not do SELECT
of all values. Below the code snippet:
<form method="get">
<select name="bairro">
<option>A</option>
<option>B</option>
<option>C</option>
</select>
</form>
and the query:
$bairro = $_GET['bairro'];
$query=("SELECT * FROM terrenos WHERE bairro = '".$bairro."'"};
If I select A and B for example, the URL is &bairro=A&bairro=B
, but then $_GET
only takes 1 neighborhood, how do I use all to return to the query?
Thank you!