I am trying to construct a mysql query string to pull out certain records but only if the date in the database is greater than the current date.
So I have this so far and I am not sure if this is a legal syntax…
date_default_timezone_set('America/Los_Angeles');
$current_date = date("Y-m-d");
$sql = "SELECT * FROM `coupons` WHERE status = 1 AND end_date > '$current_date'";
Thanks for your help.
It’s legal syntax. You can use one.