46 users online (0 members and 46 guests)  

Thread: MySQL query


  Results 1 to 2 of 2

Related

  1. Replies: 1
  2. help with mysql query    Forum: Databases
    Replies: 2
  3. mysql query / function problem....    Forum: Databases
    Replies: 7
  4. Replies: 4
  5. Replies: 0
  1. #1
    deliriousthunder's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Feb 2009
    Posts
    29

    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. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: MySQL query

    Use the MySQL CURDATE() function. For example:

    Code:
    SELECT * FROM my_table WHERE `StartDate` > CURDATE();



Tags for this Thread