$date = date("Y-m-d");
How do I get date comparison in MySQL query that looks something like this:
WHERE expired_date > '$date'
An easier/cleaner way to do this is as follows:
SELECT expired_date FROM subscription WHERE expired_date > CURRENT_TIMESTAMP;
What Pullo has said above would be better but if you need to convert a string to date in MySQL look at the STR_TO_DATE function.
pullo, using CURRENT_DATE instead of CURRENT_TIMESTAMP will more closely match the original requirements here
Oops. Right you are! Thanks rudy.
I knew I can rely on your guys here.
This topic is now closed. New replies are no longer allowed.