I want to only display records that are 14 days old or younger.
Is this a correct format ?
$sql = "SELECT * FROM stuff WHERE flag1 =\"y\" AND ((date(\"Y-m-d\")-create_date)<14 days)";
Thanks for your help.
I would do something like this:
$SQL = "SELECT * FROM stuff WHERE flag1='y' AND (DATEDIFF(CURDATE(), create_date) <= 14));
That's just me though. Check out http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html if you haven't yet. A lot of really useful info there.
thanks - if that works I wont search cos this looks neat enough for me!