Hi,
I haveHow do I get date comparison in MySQL query that looks something like this:Code:$date = date("Y-m-d");
ThanksCode:SELECT expired_date FROM subscription WHERE expired_date > '$date'
| SitePoint Sponsor |
Hi,
I haveHow do I get date comparison in MySQL query that looks something like this:Code:$date = date("Y-m-d");
ThanksCode:SELECT expired_date FROM subscription WHERE expired_date > '$date'

Hi there,
An easier/cleaner way to do this is as follows:
Code MySQL:SELECT expired_date FROM subscription WHERE expired_date > CURRENT_TIMESTAMP;
HTH
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
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

How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
Thanks,
I knew I can rely on your guys here.![]()
Bookmarks