0
In my code, I have a calendar where the user selects the period he wants to analyze. The code is this:
<input type="text" name="daterange" value="01/01/2012 - 20/04/2018" />
<script type="text/javascript">
$(function() {
$('input[name="daterange"]').daterangepicker({
timePicker: false,
timePickerIncrement: 0,
locale: {
format: 'DD/MM/YYYY'
}
});
});
</script>
I need to use this range to filter a mysql data table. I’ve used the function between
with two distinct dates, thus:
SELECT * FROM `producao_hora` where data between '19/04/2018' and '20/04/2018'
But I don’t know how to turn the datepicker date range into a variable I could play in that select
. How could it be done?
NOTE: Codes in PHP are also welcome!