1
I have a system in PHP
where I use the datatables plugin, I can sort by date, but the user wants to stipulate the period for consultation, for example:
Select from 01/01/2016 until 01/31/2016 and all data from this period will be displayed.
I have to create the fields for the user to select the desired search month and with this I need to create a query for each month of a given year that the user select or there is another way, what to do in this case?
Example: I would have to do a query for Jan, Feb, Mar, April.. and by year 2015, 2016, 2017 and ...?
I know this query, the question is how to apply it in the system. Surely I will create two date type fields for the user to select the period you want, after that I send the information typed for this query? Would that be it?
SELECT suascolunas

 FROM sau tabela

 WHERE colunaData BETWEEN $dataInicio AND $dataFinal;
– Quito Gaspar
I just saw the message. That’s right, it’s correct. Just remember that in sql the date needs to be like this > 'Y-m-d'
– LucaoA