Thread: MySQL query
Results 1 to 2 of 2
help with mysql query Forum: DatabasesReplies: 2
mysql query / function problem.... Forum: DatabasesReplies: 7
Downgrade to non-sub query, but how to change this mysql statement?? Forum: PHP ForumReplies: 0
11-07-2009, 11:41 AM #1
I have a database table which contains records of a list of events, obviously there are several properties related to each event, one of which is the "Start Date".
For a page on my site I need to query that table, and display a list of the events which haven't yet started, (i.e. upcoming events).
In the table, the field type in the database table is date, so I figure there must be an easy way to query it so that it only returns events which haven't started yet.
Just looking for a hint really, haven't tried it or researched it yet.
11-20-2009, 06:13 PM #2
Re: MySQL query
Use the MySQL CURDATE() function. For example:
SELECT * FROM my_table WHERE `StartDate` > CURDATE();