I'm having a bit of a problem comparing a date in the past to dates in MySQL database. Here's what i'm trying to do:
$LastMonth = date("m")-1;
$Previous = date("Y-$LastMonth-d");
$QRY = mysql_query("SELECT * FROM Questions WHERE Created>$Previous ORDER BY Created DESC,Time DESC LIMIT $offset,$Limit ",$db) or die($errMsg);
The format of date in database is DATE as YYYY-MM-DD
It works it's just pulling up all entries in the database. Rather than those which have been entered within the last month. Help greatly appreciated.