Hi so I have a PHP page which returns information and the time that information was inputted in.
What I am wanting to do is filter that time so for example only entries between now and six months ago appear, and I also wish to have another option which does between now and twelve months ago.
The information would be printed with json so that Ajax can make use of the data easily. I am posting a variable with the value 6 or 12 which determines the desired length however I seem to not be able to find any SQL statements which would work.
I have tried using the WEEKOFYEAR() SQL function to no avail it just threw errors.
$sql = "SELECT data, data2 FROM userdetails where userid = '$Id'";
$result = $conn->query($sql);
The field which is set as a date is called dateSet and I am thinking whether to use a between function within the SQL. The information is put into an array so doing it within the SQL statement would be beneficial.