Thread: MySQL query
Results 1 to 2 of 2
Related
-
Replies: 1
-
help with mysql query Forum: Databases
Replies: 2 -
mysql query / function problem.... Forum: Databases
Replies: 7 -
Replies: 4
-
Downgrade to non-sub query, but how to change this mysql statement?? Forum: PHP Forum
Replies: 0
-
11-07-2009, 11:41 AM #1
MySQL query
Hi,
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.
Thanks,
Thomas
-
11-20-2009, 06:13 PM #2
Re: MySQL query
Use the MySQL CURDATE() function. For example:
Code:SELECT * FROM my_table WHERE `StartDate` > CURDATE();
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum