0

You can make a php query inside javascript?

Hello I have a small query, what happens is that I have a form, more specifically, an input type text that uses flatpickr to select a date, then I also have a select with several options ie the options are schedules ranging from 10AM to 11AM ranging from 15 minutes. The thing is the following, how would I do it so that when selecting a date it goes to the database to make a query that verifies that schedules exist with that date. And then come to the Select options and disable the ones that are already in the database. For example, let's suppose that in the database I have two records with the date 2021-03-11, and for the first one it has the schedule 10:00 and the second one 10:45. Then if I in the input selected that same date 2021-03-11, then go to the database make the query, and disable the schedules that you have in this case would be 10:00 and 10:45. With this I hope to explain myself, whoever helps me I will be eternally grateful. Please help me, I don't know how to do this.

15th Nov 2021, 5:16 AM
Eduardo Mata
2 Answers
0
What do you mean by "then go to the database make query, and disable schedules"? By disable schedules do you mean to delete schedules from database?
15th Nov 2021, 4:41 PM
Artur
Artur - avatar
0
Do you know Ajax and php how to use them for a query, can you help me?
18th Nov 2021, 5:57 AM
Eduardo Mata