I have the following mysqli query:
$query = "SELECT * FROM `products` ORDER BY product_price ASC";
I would like to only query posts which have a certain date or a date greater than the one set below in $date
. I have tried the following:
$date = '2016-02-28';
$query = "SELECT * FROM `products` WHERE last_updated > $date ORDER BY product_price ASC";
Is this the right approach? My dates are currently stored like this:
2016-03-01 07:18:17
Any help would be appreciated.