I have one select
that shows the departments:
<select name="dpto" id="dpto">
<option value="3">ATLANTICO</option>
<option value="12">CESAR</option>
</select>
What I need is that when selecting X department, it makes a query to the Database and shows me the data as follows:
<span class="tipoboletin">Tipo Boletin: <b><?php echo $B_Tipo_Boletin ?></b></span>
This is the MySQL query I have:
SELECT * FROM boletin WHERE Departamento = '" . $idDpto . "'"
Where would be $idDpto
the value
department you select.
you could do it in the following way this is just an example there are many ways to do it this is one of the easiest example:
js file
callback.php
I hope it helps you, greetings!