From: "Erick Hitter" <[EMAIL PROTECTED]>

> Hello,
> I run the web site for a band, and I am currently working on the
> shows list for the band. I have all of the shows listed in a database
> right now. I don't want to remove the shows that occurred in the past,
> but instead I want to have a query find only the shows that occur in
> the future. I have the date of each show in a MySQL date field,
> formatted as such: year-month-day (2002-07-17). Is there a way to use
> a query to compare the show date to the current date and only return
> future events? I'm using PHP to pull the information into the shows
> section.

Add the following clause to your query:

WHERE datefield >= NOW()

It'll compare each show's date (in datefield, or whatever you named it) to
the current datetime, returned by the function NOW(), and only return those
dates equal to or later than the current datetime.



--
Mike Johnson                 . : . : .   AIM: denonymous
http://www.coldcircuit.net   ' : ' : '   http://65.96.177.11

"According to one of our readers, the new MacOS X contains another
 Satanic holdover from the 'BSD Unix' OS mentioned above; to open up
 certain locked files one has to run a program much like the DOS
 prompt in Microsoft Windows and type in a secret code: 'chmod 666'."




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to