PHP take the value of a select and input whenever these are changed and query MYSQL

Asked

Viewed 106 times

0

I have an input field that is a date that changes according to the date chosen in the calendar and 2 selects that are start and end time:

<input type="text" value="13-08-2017" name="pickdate">

<select id="inicio">
<option value="8">8:00</option>
<option value="9">9:00</option>
</select>

<select id="fim">
<option value="8">10:00</option>
<option value="9">11:00</option>
</select>

With this data (date, start and end) php makes a query in mysql to bring service providers available at these times.

SELECT *
FROM fcs_prestadores_pedidos
WHERE $var_entrada NOT BETWEEN hora_entrada AND hora_saida
AND $var_saida NOT BETWEEN hora_saida AND hora_saida

The query is ready and working, my question is the following: How to make so that whenever the input or select is changed, it redoes the query and update the result?

  • This one using Jquery?

  • You will need javascript. If you are using Jquery you can make a query via ajax.

  • You’ve done something already jQuery?

  • did little jQuery, was using javascript

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.