Foreword: I tried to find an answer to this and while there are some similarities in some of the answered questions, there were no matches.
I'm trying to generate 3 month reports but only the current date is returning a value.
<?php
// Db connect
include_once ('db.php');
global $con2;
// 3 month reports
$date_from = date("d-m-Y", strtotime(" -3 months"));
$date_to = date('d-m-Y');
// Count
$get = "select * from table1 where date between '$date_from' and '$date_to'";
$get_connect = mysqli_query($con2, $get);
$get_rows = mysqli_num_rows($get_connect);
// Display data
echo $get_rows;
?>
Additional info. The dates already stored in the date column of table1 are in exactly the same format as the variables eg: 10-10-2017 The entires which are from today are being displayed but nothing else is. Is this because PHP can only read up till the first - dash?