![]() |
| HTML | PHP Scripts | Webmaster Tools | Webmaster Forums | Web Hosting | Domain Names | Webmaster Books |
|
|
#1 |
|
Junior Member
Join Date: Feb 2009
Webmaster Discussions: 29
Rep Power: 10 ![]() |
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 |
|
|
|
|
|
#2 |
|
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21 ![]() ![]() ![]() ![]() |
Re: MySQL query
Use the MySQL CURDATE() function. For example:
Code:
SELECT * FROM my_table WHERE `StartDate` > CURDATE();
__________________
Be sure to click the reputation icon to give rep to the person who helped you. For web design/development services, check Silentium Designs. |
|
|
|
![]() |
| Bookmarks |
| Tags |
| mysql, query |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Webmaster Discussions
|
||||
| Thread | Webmaster Discussion Starter | Forum | Replies | Last Post |
| mysql query / function problem.... | pegboy | Databases | 7 | 08-29-2006 01:53 PM |
| How to insert IF statement into MySQL query displaying results in 2 columns? | petewalton | PHP Forum | 4 | 06-20-2006 08:20 AM |
| Downgrade to non-sub query, but how to change this mysql statement?? | raffiq_eddy | PHP Forum | 0 | 04-26-2005 10:43 PM |
| My sql query | javier_ccs | PHP Forum | 0 | 04-20-2005 02:13 PM |