The date field in the database tables I am currently working on is in the form of varchar and given in a dd.mm.yyyy format.
For example date : 03.02.2018
There is screen above
So when I send to data with ajax is not working correctly.
There are code below
function clean($data) {
global $con;
$data = mysqli_real_escape_string($con, strip_tags($data));
return $data;
}
$start_date = clean($_POST['start']);
$end_date = clean($_POST['end']);
if (isset($start_date) && isset($end_date)) {
$get_date = "SELECT * FROM records WHERE reservations BETWEEN '$start_date' AND '$end_date' ";
}
Start date and End Date are same working for example today or yesterday. But when dates are different dont work for example start date : 03.02.2018 end date :03.03.2018
Best Regards
Thank you.

date-field in the database, is it? MySQL stores dates in the format:YYYY-MM-DD.BETWEENforvarcharcolumn type in MySQL, you need some workaround.