"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

Go Back   Webmaster Forums > Code Forum > PHP Forum

Reply
 
Thread Tools Rate this Webmaster Discussion
Old 11-07-2009, 11:41 AM   #1
deliriousthunder
Junior Member
 
Join Date: Feb 2009
Webmaster Discussions: 29
Rep Power: 10
deliriousthunder is on a distinguished road
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


deliriousthunder is offline   Reply With Quote
Old 11-20-2009, 06:13 PM   #2
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
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.
jthayne is offline   Reply With Quote
Reply

Bookmarks

Tags
mysql, query

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


All times are GMT -5. The time now is 08:54 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.