Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Hull, UK
    Posts
    2

    Red face Unanswered: Please help with multiple filters

    Hi all,

    I'm currently using Dreamweaver MX, PHP and MySQL to create a relatively simple website where I store events that are happening at skateparks throughout the UK.

    My problem is that I don't have a clue about how to filter my records to show only those that are after todays date.

    I have:

    SELECT *
    FROM news
    WHERE fromDate >= 'colname' AND news.type = 'e'
    ORDER BY fromDate DESC

    'colname' = $_SERVER['TTOD(DATETIME())']

    The event types ('e') are selected successfully, but, unfortunately, the current date thing doesn't seem to do anything.

    How can I filter my recordset with current system date?

    Any help greatly appreciated.
    Last edited by a_beginner; 01-26-04 at 18:26.

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Use something like

    SELECT *
    FROM news
    WHERE fromDate >= now() AND news.type = 'e'
    ORDER BY fromDate DESC
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Dec 2003
    Location
    Hull, UK
    Posts
    2

    Thumbs up Big Thank You

    omiossec (?) -- A big thank you -- that worked perfectly.

    I'd read elsewhere on the web that now() didn't work -- I obviously went to the wrong site!!

    Wes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •